public void ArchRuleExtensionsTest() { _architecture.CheckRule(_trueRule); _trueRule.Check(_architecture); Assert.ThrowsException <AssertFailedException>(() => _architecture.CheckRule(_falseRule)); Assert.ThrowsException <AssertFailedException>(() => _falseRule.Check(_architecture)); Assert.AreEqual(_expectedErrorMessage, RemoveAssertionText(Assert.ThrowsException <AssertFailedException>(() => _architecture.CheckRule(_falseRule)).Message)); Assert.AreEqual(_expectedErrorMessage, RemoveAssertionText(Assert.ThrowsException <AssertFailedException>(() => _falseRule.Check(_architecture)).Message)); }
public void ArchRuleExtensionsTest() { _architecture.CheckRule(_trueRule); _trueRule.Check(_architecture); Assert.Throws <AssertionException>(() => _architecture.CheckRule(_falseRule)); Assert.Throws <AssertionException>(() => _falseRule.Check(_architecture)); Assert.AreEqual(_expectedErrorMessage, Assert.Catch <AssertionException>(() => _architecture.CheckRule(_falseRule)).Message); Assert.AreEqual(_expectedErrorMessage, Assert.Catch <AssertionException>(() => _falseRule.Check(_architecture)).Message); }