Пример #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);
Пример #2
0
 public static bool Nonnull(
     object?instance,
     string?message = null)
 => Asserts.True(instance != null,
                 message ?? "Expected reference to be nonnull.");
Пример #3
0
 public static void Null(
     object?instance,
     string message = "Expected reference to be null.")
 => Asserts.True(instance == null, message);
Пример #4
0
 public static bool False(bool value, string?message = null)
 => Asserts.True(!value, message ?? "Expected to be false.");
Пример #5
0
 public static bool True(bool value, string?message = null)
 => value || Asserts.Fail(message ?? "Expected to be true.");
Пример #6
0
 public static bool IsA(
     object?instance,
     Type expected,
     string?message = null)
 => Asserts.Nonnull(instance, message) &&
 Asserts.Equal(instance !.GetType(), expected, message);
Пример #7
0
 public static bool IsA <TExpected>(object?instance, string?message = null)
 => Asserts.IsA(instance, typeof(TExpected), message);
Пример #8
0
 public static bool Equal(
     string expected,
     string actual,
     string?message = null)
 => Asserts.Equal <string>(expected, actual, message);