OpenPetra
Free Administration Software for Non-Profits
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
Ict.Common.Verification.TVerificationHelper Class Reference

Helper Methods for dealing with TVerificationResults. More...

Static Public Member Functions

static bool AreVerificationResultsIdentical (TVerificationResult AVerificationResult1, TVerificationResult AVerificationResult2, bool ACompareResultContextsAsStrings=false)
 Checks whether two TVerificationResults are completely identical. The comparison takes all the data they hold into consideration. More...
 
static bool IsNullOrOnlyNonCritical (TVerificationResultCollection AVerificationResult)
 Checks that a TVerificationResultCollection is either null or that it doesn't contain any TVerificationResult items that are 'CriticalErrors'! More...
 
static string FormatVerificationCollectionItems (TVerificationResultCollection AVerifColl)
 Creates a string that contains the data of all the TVerificationResults in the Collection. More...
 
static void SetColumnErrorText (DataColumnChangeEventArgs AEventArgs, TVerificationResult AVerificationResultEntry, String AControlName, Boolean AResetValue)
 Calls the M:DataRow.SetColumnError(DataColumn, String) Method of a DataRow's Column to the TVerificationResult.ResultText Property of the passed in TVerificationResult. More...
 
static bool ResultsContainErrorCode (TVerificationResultCollection AResultsCollection, string AErrorCode)
 Examines a TVerificationResultCollection and returns true if one of the results has the specified error code More...
 

Detailed Description

Helper Methods for dealing with TVerificationResults.

Member Function Documentation

◆ AreVerificationResultsIdentical()

static bool Ict.Common.Verification.TVerificationHelper.AreVerificationResultsIdentical ( TVerificationResult  AVerificationResult1,
TVerificationResult  AVerificationResult2,
bool  ACompareResultContextsAsStrings = false 
)
inlinestatic

Checks whether two TVerificationResults are completely identical. The comparison takes all the data they hold into consideration.

Parameters
AVerificationResult1First TVerificationResult.
AVerificationResult2Second TVerificationResult.
ACompareResultContextsAsStringsSet to true to compare the ResultContexts not as objects, but compare what a call of the .ToString() Method on the two object yields. (Default: false.)
Returns
True if the two TVerificationResults are completely identical, otherwise false.

◆ FormatVerificationCollectionItems()

static string Ict.Common.Verification.TVerificationHelper.FormatVerificationCollectionItems ( TVerificationResultCollection  AVerifColl)
inlinestatic

Creates a string that contains the data of all the TVerificationResults in the Collection.

Returns
String that contains the data of all the TVerificationResults in the Collection. The data of the TVerificationResults are separated by System.Environment.NewLines.

◆ IsNullOrOnlyNonCritical()

static bool Ict.Common.Verification.TVerificationHelper.IsNullOrOnlyNonCritical ( TVerificationResultCollection  AVerificationResult)
inlinestatic

Checks that a TVerificationResultCollection is either null or that it doesn't contain any TVerificationResult items that are 'CriticalErrors'!

Prefer using this Method over the use of the TVerificationResultCollection.HasCriticalErrors Method, as using the latter involves a null check on the TVerificationResultCollection to guard against a NullReferenceException in case the TVerificationResultCollection is null — IsNullOrOnlyNonCritical takes care of that! In the context of Unit Testing this Method can be used for 'Guard Asserts' to check that the TVerificationResultCollection that is returned from server calls is null or holds only non-critical TVerificationResult items (see also Method 'EnsureNullOrOnlyNonCriticalVerificationResults' of the CommonNUnitFunctions Class for a convenient 'wrapper'!!!)

Parameters
AVerificationResultTVerificationResultCollection reference (can be null!).
Returns
True if AVerificationResult is null. If isn't null and it contains any TVerificationResult items that are CriticalErrors then this Method returns false, otherwise true.

◆ ResultsContainErrorCode()

static bool Ict.Common.Verification.TVerificationHelper.ResultsContainErrorCode ( TVerificationResultCollection  AResultsCollection,
string  AErrorCode 
)
inlinestatic

Examines a TVerificationResultCollection and returns true if one of the results has the specified error code

◆ SetColumnErrorText()

static void Ict.Common.Verification.TVerificationHelper.SetColumnErrorText ( DataColumnChangeEventArgs  AEventArgs,
TVerificationResult  AVerificationResultEntry,
String  AControlName,
Boolean  AResetValue 
)
inlinestatic

Calls the M:DataRow.SetColumnError(DataColumn, String) Method of a DataRow's Column to the TVerificationResult.ResultText Property of the passed in TVerificationResult.

Parameters
AEventArgsAn instance of DataColumnChangeEventArgs.
AVerificationResultEntryTVerificationResult which has its TVerificationResult.ResultText Property set.
AControlNameName of the Control to which the TVerificationResult is related.
AResetValueSet this to true to retain the DataColumnChangeEventArgs.ProposedValue.

The documentation for this class was generated from the following file: