public static TOwner BeNullOrEmpty <TOwner>(this IDataVerificationProvider <string, TOwner> should) { return(should.Satisfy(actual => string.IsNullOrEmpty(actual), "be null or empty")); }
public static TOwner BeNullOrWhiteSpace <TOwner>(this IDataVerificationProvider <string, TOwner> should) { return(should.Satisfy(actual => string.IsNullOrWhiteSpace(actual), "be null or white-space")); }
public static TOwner BeNull <TData, TOwner>(this IDataVerificationProvider <TData, TOwner> should) => should.Satisfy(actual => Equals(actual, null), "be null");
public static TOwner BeFalse <TOwner>(this IDataVerificationProvider <bool?, TOwner> should) => should.Be(false);
public static TOwner BeTrue <TOwner>(this IDataVerificationProvider <bool?, TOwner> should) => should.Be(true);
/// <summary> /// Verifies that object is equal to <paramref name="expected"/> value. /// </summary> /// <typeparam name="TData">The type of the data.</typeparam> /// <typeparam name="TOwner">The type of the owner.</typeparam> /// <param name="should">The verification provider.</param> /// <param name="expected">The expected value.</param> /// <returns>The owner instance.</returns> public static TOwner Be <TData, TOwner>(this IDataVerificationProvider <TData, TOwner> should, TData expected) => should.Satisfy(actual => Equals(actual, expected), "be {0}", expected);
private static IDataVerificationProvider <TData, TOwner> GetNegationVerificationProvider <TData, TOwner>(IDataVerificationProvider <TData, TOwner> verificationProvider) { if (verificationProvider is DataVerificationProvider <TData, TOwner> dataVerificationProvider) { return(dataVerificationProvider.Not); } else { return((IDataVerificationProvider <TData, TOwner>)verificationProvider.GetType().GetPropertyWithThrowOnError("Not").GetValue(verificationProvider)); } }