当前位置: 首页>>代码示例>>C#>>正文


C# Customer.ReadyToPlaceOrder方法代码示例

本文整理汇总了C#中Customer.ReadyToPlaceOrder方法的典型用法代码示例。如果您正苦于以下问题:C# Customer.ReadyToPlaceOrder方法的具体用法?C# Customer.ReadyToPlaceOrder怎么用?C# Customer.ReadyToPlaceOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customer的用法示例。


在下文中一共展示了Customer.ReadyToPlaceOrder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CustomerIsReadyToOrder

        public void CustomerIsReadyToOrder()
        {
            Customer Bob = new Customer();
            Restaurant joes = new Restaurant();
            MenuItem coke = new MenuItem();
            coke.Name = "coke";
            MenuItem lasagna = new MenuItem();
            lasagna.Name = "lasagna";
            MenuItem milkshake = new MenuItem();
            milkshake.Name = "milkshake";

            joes.MenuItems.Add(coke);
            joes.MenuItems.Add(lasagna);
            joes.MenuItems.Add(milkshake);

            //The object initializer syntax used for bobsOrder is a shortcut used to set properties on an object when creating it
            Order bobsOrder = new Order
            {
                Drink = "coke",
                Entree = "lasagna",
                Dessert = "milkshake"
            };
            Assert.IsTrue(bobsOrder.VerifyOrderComplete());
            Assert.IsTrue(Bob.ReadyToPlaceOrder(bobsOrder, joes));
        }
开发者ID:C-Stein,项目名称:LunchQuiz,代码行数:25,代码来源:CustomerTests.cs

示例2: CustomerIsNotReadyToOrder

        public void CustomerIsNotReadyToOrder()
        {
            Customer Bob = new Customer();
            Restaurant joes = new Restaurant();
            MenuItem coke = new MenuItem();
            coke.Name = "coke";
            MenuItem lasagna = new MenuItem();
            lasagna.Name = "lasagna";
            MenuItem milkshake = new MenuItem();
            milkshake.Name = "milkshake";

            joes.MenuItems.Add(coke);
            joes.MenuItems.Add(lasagna);
            joes.MenuItems.Add(milkshake);

            Order bobsOrder = new Order
            {
                Drink = "coke",
                Entree = "lasagna",
                //Dessert = "milkshake"
            };
            Assert.IsFalse(bobsOrder.VerifyOrderComplete()); //False!
            Assert.IsFalse(Bob.ReadyToPlaceOrder(bobsOrder, joes)); //Also false!
        }
开发者ID:C-Stein,项目名称:LunchQuiz,代码行数:24,代码来源:CustomerTests.cs

示例3: CustomerIsStillNotReadyToOrder

        public void CustomerIsStillNotReadyToOrder()
        {
            Customer Bob = new Customer();
            Restaurant joes = new Restaurant();
            MenuItem coke = new MenuItem();
            coke.Name = "coke";
            MenuItem lasagna = new MenuItem();
            lasagna.Name = "lasagna";
            MenuItem milkshake = new MenuItem();
            milkshake.Name = "milkshake";

            joes.MenuItems.Add(coke);
            joes.MenuItems.Add(lasagna);
            //joes.MenuItems.Add(milkshake); Milkshakes are not on the menu =-(

            Order bobsOrder = new Order
            {
                Drink = "coke",
                Entree = "lasagna",
                Dessert = "milkshake"
            };
            Assert.IsTrue(bobsOrder.VerifyOrderComplete());
            Assert.IsFalse(Bob.ReadyToPlaceOrder(bobsOrder, joes));
        }
开发者ID:C-Stein,项目名称:LunchQuiz,代码行数:24,代码来源:CustomerTests.cs

示例4: CustomerIsReadyToOrderFromAllTypesOfRestaurants

        public void CustomerIsReadyToOrderFromAllTypesOfRestaurants()
        {
            Customer Bob = new Customer();
            FastFood krustys = new FastFood(); //Uncomment this line after noticing what is different
            MenuItem coke = new MenuItem();
            coke.Name = "coke";
            MenuItem lasagna = new MenuItem();
            lasagna.Name = "lasagna";
            MenuItem milkshake = new MenuItem();
            milkshake.Name = "milkshake";

            krustys.MenuItems.Add(coke);
            krustys.MenuItems.Add(lasagna);
            krustys.MenuItems.Add(milkshake);

            //The object initializer syntax used for bobsOrder is a shortcut used to set properties on an object when creating it
            Order bobsOrder = new Order
            {
                Drink = "coke",
                Entree = "lasagna",
                Dessert = "milkshake"
            };
            Assert.IsTrue(bobsOrder.VerifyOrderComplete());
            Assert.IsTrue(Bob.ReadyToPlaceOrder(bobsOrder, krustys));
        }
开发者ID:C-Stein,项目名称:LunchQuiz,代码行数:25,代码来源:CustomerTests.cs


注:本文中的Customer.ReadyToPlaceOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。