Ejemplo n.º 1
0
 public static void IsFalse(this VAssertSingle <bool> assert)
 {
     if (assert.Value)
     {
         assert.Error("Value expected to be false");
     }
 }
Ejemplo n.º 2
0
 public static void IsTrue(this VAssertSingle <bool> assert)
 {
     if (!assert.Value)
     {
         assert.Error("Value expected to be true");
     }
 }
Ejemplo n.º 3
0
        public static bool IsNotNull <T>(this VAssertSingle <T> assert)
            where T : class
        {
            var result = assert.Value != null;

            if (!result)
            {
                assert.Error("Cannot be null");
            }

            return(result);
        }
Ejemplo n.º 4
0
 public static bool IsGreaterThan <T>(this VAssertSingle <T> assert, int maximum)
     where T : IComparable
 {
     // TODO: Haven't actually tested this yet
     return(assert.IsTrue(assert.Value.CompareTo(maximum) > 0, "Must be greater than " + maximum));
 }
Ejemplo n.º 5
0
 public static bool IsUnderLength(this VAssertSingle <string> assert, int maximumLength)
 {
     return(assert.IsTrue(assert.Value.Length < maximumLength, "String length cannot exceed " + maximumLength));
 }
Ejemplo n.º 6
0
 public static VAssertSingle <int> Length(this VAssertSingle <string> assert)
 {
     return(new VAssertSingle <int>(assert.Name + ".Length", assert.Value.Length));
 }
Ejemplo n.º 7
0
 public static bool IsEqual(this VAssertSingle <string> assert, string expected)
 {
     return(assert.IsTrue(assert.Value.Equals(expected), "Strings must be equal"));
 }