public void IdentifiedByReturnsExpectedResult()
        {
            var sut = new AggregateBuilder();
            var expectedVersion = sut.ExpectedVersion;
            var root = sut.Root;

            var result = sut.IdentifiedBy("identifier");

            Assert.That(result, Is.SameAs(sut));
            Assert.That(sut.Identifier, Is.EqualTo("identifier"));
            Assert.That(sut.ExpectedVersion, Is.EqualTo(expectedVersion));
            Assert.That(sut.Root, Is.SameAs(root));
        }
        public void IdentifiedByReturnsExpectedResult()
        {
            var sut             = new AggregateBuilder();
            var expectedVersion = sut.ExpectedVersion;
            var root            = sut.Root;

            var result = sut.IdentifiedBy("identifier");

            Assert.That(result, Is.SameAs(sut));
            Assert.That(sut.Identifier, Is.EqualTo("identifier"));
            Assert.That(sut.ExpectedVersion, Is.EqualTo(expectedVersion));
            Assert.That(sut.Root, Is.SameAs(root));
        }
        public void BuildReturnsExpectedResult()
        {
            var          sut             = new AggregateBuilder();
            const string identifier      = "identifier";
            const int    expectedVersion = 123;
            var          root            = new AggregateRootEntityStub();

            var result = sut.IdentifiedBy(identifier).ExpectVersion(expectedVersion).WithRoot(root).Build();

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Identifier, Is.EqualTo(identifier));
            Assert.That(result.ExpectedVersion, Is.EqualTo(expectedVersion));
            Assert.That(result.Root, Is.SameAs(root));
        }
        public void BuildReturnsExpectedResult()
        {
            var sut = new AggregateBuilder();
            const string identifier = "identifier";
            const int expectedVersion = 123;
            var root = new AggregateRootEntityStub();

            var result = sut.IdentifiedBy(identifier).ExpectVersion(expectedVersion).WithRoot(root).Build();

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Identifier, Is.EqualTo(identifier));
            Assert.That(result.ExpectedVersion, Is.EqualTo(expectedVersion));
            Assert.That(result.Root, Is.SameAs(root));
        }