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.But, Is.EqualTo(Optional <Exception> .Empty));
        }
        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.But, Is.EqualTo(Optional<Exception>.Empty));
        }
        public void FailWithActualExceptionReturnsExpectedResult()
        {
            var sut    = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);
            var actual = new Exception();

            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.ButException, Is.EqualTo(new Optional <Exception>(actual)));
        }
        public void FailWithActualExceptionReturnsExpectedResult()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);
            var actual = new Exception();

            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.ButException, Is.EqualTo(new Optional<Exception>(actual)));
        }
        public void FailWithActualEventsReturnsExpectedResult()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);

            var actual = new[] { new Tuple <string, object>(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.Buts, Is.EqualTo(new Optional <Tuple <string, object>[]>(actual)));
            Assert.That(result.But, Is.EqualTo(Optional <Exception> .Empty));
        }
        public void FailWithActualEventsReturnsExpectedResult()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);

            var actual = new[] {new Tuple<string, object>(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.Buts, Is.EqualTo(new Optional<Tuple<string, object>[]>(actual)));
            Assert.That(result.But, Is.EqualTo(Optional<Exception>.Empty));
        }
        public void FailWithNullEventsThrows()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);

            Assert.Throws <ArgumentNullException>(() => { var _ = sut.Fail((Tuple <string, object>[])null); });
        }
        public void FailWithNullExceptionThrows()
        {
            var sut = new ExceptionCentricTestSpecification(NoEvents, Message, Exception);

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