public void SetUp()
        {
            Func <IAggregateRootEntity> sutFactory = () => (IAggregateRootEntity)null;
            var thens = new[] { new object(), new object() };

            _sut = new EventCentricAggregateConstructorTestSpecification(
                sutFactory,
                thens);
        }
        public void UsingDefaultCtorReturnsInstanceWithExpectedProperties()
        {
            Func <IAggregateRootEntity> sutFactory = () => (IAggregateRootEntity)null;
            var thens = new[] { new object(), new object() };

            var sut = new EventCentricAggregateConstructorTestSpecification(
                sutFactory,
                thens);

            Assert.That(sut.SutFactory, Is.SameAs(sutFactory));
            Assert.That(sut.Thens, Is.EquivalentTo(thens));
        }
        public void RunReturnsExpectedResultWhenFailedBecauseExceptionOccurred()
        {
            var specification = new EventCentricAggregateConstructorTestSpecification(
                () => new FailExceptionCase(),
                new object[0]);

            var result = _sut.Run(specification);

            Assert.That(result.Passed, Is.False);
            Assert.That(result.Failed, Is.True);
            Assert.That(result.ButEvents, Is.EqualTo(Optional <object[]> .Empty));
            Assert.That(result.ButException, Is.EqualTo(new Optional <Exception>(FailExceptionCase.TheException)));
        }