本文整理汇总了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));
}
示例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!
}
示例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));
}
示例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));
}