Пример #1
0
 public static void Equality <T>(FailableFunc <T> failableFunc, T expectedValue, bool expectedEquality)
 {
     AssertAll.Of(
         () => Assert.That(failableFunc == expectedValue, Is.EqualTo(expectedEquality), "failable == expectedValue"),
         () => Assert.That(expectedValue == failableFunc, Is.EqualTo(expectedEquality), "expectedValue == failable"),
         () => Assert.That(failableFunc.Equals(expectedValue), Is.EqualTo(expectedEquality), "failable.Equals(expectedValue)"),
         () => Assert.That(Optional.AreEqual(failableFunc, expectedValue), Is.EqualTo(expectedEquality), "Optional.AreEqual(failable, expectedValue)"),
         () => Assert.That(Optional.AreEqual(expectedValue, failableFunc), Is.EqualTo(expectedEquality), "Optional.AreEqual(expectedValue, failable)")
         );
 }
Пример #2
0
 public static void Equality <T>(FailableFunc <T> a, FailableFunc <T> b, bool expectedEquality)
 {
     AssertAll.Of(
         () => Assert.That(a == b, Is.EqualTo(expectedEquality), "a == b"),
         () => Assert.That(b == a, Is.EqualTo(expectedEquality), "b == a"),
         () => Assert.That(a.Equals(b), Is.EqualTo(expectedEquality), "a.Equals(b)"),
         () => Assert.That(b.Equals(a), Is.EqualTo(expectedEquality), "b.Equals(a)"),
         () => Assert.That(Optional.AreEqual(a, b), Is.EqualTo(expectedEquality), "Optional.AreEqual(a,b)"),
         () => Assert.That(Optional.AreEqual(b, a), Is.EqualTo(expectedEquality), "Optional.AreEqual(b,a)")
         );
 }
Пример #3
0
 public static void Equality <T>(FailableFunc <T> failableFunc, Optional <T> optional, bool expectedEquality)
 {
     AssertAll.Of(
         () => Assert.That(failableFunc == optional, Is.EqualTo(expectedEquality), "failable == optional"),
         // no longer supported through ==
         // () => Assert.That(optional     == failableFunc,                  Is.EqualTo(expectedEquality), "optional == failable"),
         () => Assert.That(failableFunc.Equals(optional), Is.EqualTo(expectedEquality), "failable.Equals(optional)"),
         () => Assert.That(optional.Equals(failableFunc), Is.EqualTo(expectedEquality), "optional.Equals(failable)"),
         () => Assert.That(Optional.AreEqual(optional, failableFunc), Is.EqualTo(expectedEquality), "Optional.AreEqual(optional, failable)"),
         () => Assert.That(Optional.AreEqual(failableFunc, optional), Is.EqualTo(expectedEquality), "Optional.AreEqual(failable, optional)")
         );
 }