示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        public void FailWithNullEventsThrows()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);

            Assert.Throws <ArgumentNullException>(() => { var _ = sut.Fail((Fact[])null); });
        }