Ejemplo n.º 1
0
 public static bool Same(
     object instanceA,
     object instanceB,
     string message = "Expected references to be the same.")
 => Asserts.True(object.ReferenceEquals(instanceA, instanceB), message);
Ejemplo n.º 2
0
 public static bool Nonnull(
     object?instance,
     string?message = null)
 => Asserts.True(instance != null,
                 message ?? "Expected reference to be nonnull.");
Ejemplo n.º 3
0
 public static void Null(
     object?instance,
     string message = "Expected reference to be null.")
 => Asserts.True(instance == null, message);
Ejemplo n.º 4
0
 public static bool False(bool value, string?message = null)
 => Asserts.True(!value, message ?? "Expected to be false.");
Ejemplo n.º 5
0
 public static bool True(bool value, string?message = null)
 => value || Asserts.Fail(message ?? "Expected to be true.");
Ejemplo n.º 6
0
 public static bool IsA(
     object?instance,
     Type expected,
     string?message = null)
 => Asserts.Nonnull(instance, message) &&
 Asserts.Equal(instance !.GetType(), expected, message);
Ejemplo n.º 7
0
 public static bool IsA <TExpected>(object?instance, string?message = null)
 => Asserts.IsA(instance, typeof(TExpected), message);
Ejemplo n.º 8
0
 public static bool Equal(
     string expected,
     string actual,
     string?message = null)
 => Asserts.Equal <string>(expected, actual, message);