本文整理汇总了C#中Order.VerifyOrderComplete方法的典型用法代码示例。如果您正苦于以下问题:C# Order.VerifyOrderComplete方法的具体用法?C# Order.VerifyOrderComplete怎么用?C# Order.VerifyOrderComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.VerifyOrderComplete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: OrderIsVerifiedIfAllPartsArePresent
public void OrderIsVerifiedIfAllPartsArePresent()
{
Order myOrder = new Order();
myOrder.Drink = "diet coke";
myOrder.Entree = "burger";
myOrder.Dessert = "milkshake";
Assert.IsTrue(myOrder.VerifyOrderComplete());
}
示例3: OrderCantBeVerifiedIfSomethingIsMissing
public void OrderCantBeVerifiedIfSomethingIsMissing()
{
Order myOrder = new Order();
myOrder.Drink = "diet coke";
myOrder.Entree = "burger";
//myOrder.Dessert = ???;
Assert.IsFalse(myOrder.VerifyOrderComplete());
}
示例4: OrderCantBeVerifiedIfAnythingIsMissing
public void OrderCantBeVerifiedIfAnythingIsMissing()
{
Order myOrder = new Order();
//myOrder.Drink = ???;
myOrder.Entree = "burger";
myOrder.Dessert = "milkshake";
Assert.IsFalse(myOrder.VerifyOrderComplete());
}
示例5: 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!
}
示例6: 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));
}
示例7: 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));
}