Ejemplo n.º 1
0
 public static TOwner BeNullOrEmpty <TOwner>(this IDataVerificationProvider <string, TOwner> should)
 {
     return(should.Satisfy(actual => string.IsNullOrEmpty(actual), "be null or empty"));
 }
Ejemplo n.º 2
0
 public static TOwner BeNullOrWhiteSpace <TOwner>(this IDataVerificationProvider <string, TOwner> should)
 {
     return(should.Satisfy(actual => string.IsNullOrWhiteSpace(actual), "be null or white-space"));
 }
Ejemplo n.º 3
0
 public static TOwner BeNull <TData, TOwner>(this IDataVerificationProvider <TData, TOwner> should) =>
 should.Satisfy(actual => Equals(actual, null), "be null");
Ejemplo n.º 4
0
 public static TOwner BeFalse <TOwner>(this IDataVerificationProvider <bool?, TOwner> should) =>
 should.Be(false);
Ejemplo n.º 5
0
 public static TOwner BeTrue <TOwner>(this IDataVerificationProvider <bool?, TOwner> should) =>
 should.Be(true);
Ejemplo n.º 6
0
 /// <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);
Ejemplo n.º 7
0
 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));
     }
 }