Example #1
0
        public void MoreWithBuilders()
        {
            var samich1 = new SandwichBuilder().WithoutBread().Build();
            var samich2 = new SandwichBuilder().Build();

            Assert.NotEqual(samich1, samich2, new SandwichComparator());
        }
Example #2
0
        public void WithBuilders()
        {
            var samich1 = new SandwichBuilder().Build();
            var samich2 = new SandwichBuilder().Build();

            Assert.Equal(samich1, samich2, new SandwichComparator());
            Assert.NotSame(samich1, samich2);
        }
Example #3
0
        public void SadSamich()
        {
            var samich = new SandwichBuilder().Without(Meats.BACON).Build();

            Assert.False(samich.Ingredients.Contains(Meats.BACON));
        }
Example #4
0
        public void AddsBacon()
        {
            var samich = new SandwichBuilder().With(Meats.BACON).Build();

            Assert.True(samich.Ingredients.Contains(Meats.BACON));
        }