Ejemplo n.º 1
0
 public void InstanceOK()
 {
     //create an instance of the class
     clsOrder AnOrder = new clsOrder();
     //test to see if it exists
     Assert.IsNotNull(AnOrder);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }