public void TBefore1Fail() { var assert1 = new AssertionTest(true, false); var assert2 = new AssertionTest(false, false); Assert.Throws <SmartTestException>(() => RunTest(AnyValue.IsValid, () => Math.Sqrt(0), assert1, assert2)); Assert.AreEqual(1, assert2.Before); Assert.AreEqual(0, assert1.Before); Assert.AreEqual(0, assert1.After); Assert.AreEqual(1, assert2.After); }
public void THappyPath() { var assert1 = new AssertionTest(false, false); var assert2 = new AssertionTest(false, false); RunTest(AnyValue.IsValid, () => Math.Sqrt(0), assert1, assert2); Assert.AreEqual(1, assert2.Before); Assert.AreEqual(1, assert1.Before); Assert.AreEqual(1, assert1.After); Assert.AreEqual(1, assert2.After); }
public void Before2Fail() { var assert1 = new AssertionTest(false, false); var assert2 = new AssertionTest(true, false); Assert.Throws <SmartTestException>(() => RunTest(AnyValue.IsValid, () => DoNothing(), assert1, assert2)); Assert.AreEqual(0, assert2.Before); Assert.AreEqual(0, assert1.Before); Assert.AreEqual(0, assert1.After); Assert.AreEqual(0, assert2.After); }
public void After2Fail() { var assert1 = new AssertionTest(false, false); var assert2 = new AssertionTest(false, true); Assert.Throws <NotImplementedException>(() => RunTest(AnyValue.IsValid, () => DoNothing(), assert1, assert2)); Assert.AreEqual(1, assert2.Before); Assert.AreEqual(1, assert1.Before); Assert.AreEqual(1, assert1.After); Assert.AreEqual(0, assert2.After); }
public void After2Fail() { var assert1 = new AssertionTest(false, false); var assert2 = new AssertionTest(false, true); var exception = Assert.Throws <SmartTestException>(() => RunTest(AnyValue.IsValid, () => DoNothing(), assert1, assert2)); Assert.AreEqual(typeof(NotImplementedException), exception.InnerException?.GetType()); Assert.AreEqual(1, assert2.Before); Assert.AreEqual(1, assert1.Before); Assert.AreEqual(1, assert1.After); Assert.AreEqual(0, assert2.After); }