Пример #1
0
        public void ShouldBuildStuff()
        {
            var x = new Builder<A>();
            var a = new BuilderWithCreator<A>(() => new A());

            var b = a.WithName("name").WithDescription("description");
            var c = b.WithName("cname");

            var fromC = c.Build;
            var fromB = b.Build;

            Assert.That(fromB.Name, Is.EqualTo("name"));
            Assert.That(fromB.Description, Is.EqualTo("description"));

            Assert.That(fromC.Name, Is.EqualTo("cname"));
            Assert.That(fromC.Description, Is.EqualTo("description"));
        }
Пример #2
0
        public void ShouldBuildStuff()
        {
            var x = new Builder <A>();
            var a = new BuilderWithCreator <A>(() => new A());

            var b = a.WithName("name").WithDescription("description");
            var c = b.WithName("cname");

            var fromC = c.Build;
            var fromB = b.Build;

            Assert.That(fromB.Name, Is.EqualTo("name"));
            Assert.That(fromB.Description, Is.EqualTo("description"));

            Assert.That(fromC.Name, Is.EqualTo("cname"));
            Assert.That(fromC.Description, Is.EqualTo("description"));
        }