public void FailReturnsExpectedResult() { var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception); var result = sut.Fail(); Assert.That(result.Specification, Is.SameAs(sut)); Assert.That(result.Passed, Is.False); Assert.That(result.Failed, Is.True); Assert.That(result.ButException, Is.EqualTo(Optional <Exception> .Empty)); }
public void FailWithActualEventsReturnsExpectedResult() { var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception); var actual = new[] { new Fact(Model.Identifier1, new object()) }; var result = sut.Fail(actual); Assert.That(result.Specification, Is.SameAs(sut)); Assert.That(result.Passed, Is.False); Assert.That(result.Failed, Is.True); Assert.That(result.ButEvents, Is.EqualTo(new Optional <Fact[]>(actual))); Assert.That(result.ButException, Is.EqualTo(Optional <Exception> .Empty)); }
public void FailWithNullEventsThrows() { var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception); Assert.Throws <ArgumentNullException>(() => { var _ = sut.Fail((Fact[])null); }); }