示例#1
0
 public void InstanceOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //test to see if it exists
     Assert.IsNotNull(AnOrder);
 }
示例#2
0
 public void OrderItemPriceOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //create a price
     double price = 22.22;
     //assign the data to the property
     AnOrder.Price = price;
     //test to see if the values are the same
     Assert.AreEqual(AnOrder.Price, price);
 }
示例#3
0
 public void OrderDateOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //create a date
     DateTime date = DateTime.Now.Date;
     //assign the data to the property
     AnOrder.Date = date;
     //test to see if the values are the same
     Assert.AreEqual(AnOrder.Date, date);
 }
示例#4
0
 public void ItemDescOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //create variable to hold ItemDesc
     string ItemDesc = "Test data";
     //assign ItemDesc to AnOrder.ItemDesc
     AnOrder.ItemDesc = ItemDesc;
     //check that both variables are the same
     Assert.AreEqual(AnOrder.ItemDesc, ItemDesc);
 }
示例#5
0
 public void CustomerIDOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //create variable to hold CustomerID
     int CustID = 123;
     //assign CustID to AnOrder.CustomerID
     AnOrder.CustomerID = CustID;
     //check that both variables are the same
     Assert.AreEqual (AnOrder.CustomerID, CustID);
 }
示例#6
0
 public void Valid()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //create boolean value
     Boolean OK = false;
     //create variable to hold CustomerID
     int CustID = 123;
     //invoke the method
     OK = AnOrder.Valid(CustID);
     //check that the result is correct
     Assert.IsTrue(OK);
 }