示例#1
0
        public void TestGoFBuilder()
        {
            PizzaBuilder pb      = new PizzaBuilder();
            var          myPizza = pb.Build("thin", "normal", "onion", "mushroom", "black olives");

            Assert.True(myPizza.IsReady);
        }
示例#2
0
        public void TestGoFBuilderForBadArgs()
        {
            try
            {
                PizzaBuilder pb      = new PizzaBuilder();
                var          myPizza = pb.Build("thin", "normal", "anchovies", "mushroom", "black olives");

                Assert.True(false);
            }
            catch (Exception ex)
            {
                Assert.True(ex is ArgumentException);
            }
        }
示例#3
0
        public void TestGoFBuilderForNullArgs()
        {
            try
            {
                PizzaBuilder pb      = new PizzaBuilder();
                var          myPizza = pb.Build(null);

                Assert.True(false);
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }