Ejemplo n.º 1
0
 public void InstanceOK()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //test to see that it exists
     Assert.IsNotNull(AInvoice);
 }
Ejemplo n.º 2
0
 public void AddressNoPropertyOK()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //create some test data to assign to the property
     Int32 AddressNo = 1;
     //assign the data to the property
     AInvoice.AddressNo = AddressNo;
     //test to see that the two values are the same
     Assert.AreEqual(AInvoice.AddressNo, AddressNo);
 }
Ejemplo n.º 3
0
 public void AddressProperty()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //create some test data to assign to the property
     string SomeAddress = "Leicestershire";
     //assign the data to the property
     AInvoice.Address = SomeAddress;
     //test to see that the two values are the same
     Assert.AreEqual(AInvoice.Address, SomeAddress);
 }
Ejemplo n.º 4
0
 public void ValidMethodOK()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //boolean variable to store the result of the validation
     Boolean OK = false;
     //create some test data to assign to the property
     string SomeAddress = "Leicestershire";
     //invoke the method
     OK = AInvoice.Valid(SomeAddress);
     //test to see that the result is correct
     Assert.IsTrue(OK);
 }
Ejemplo n.º 5
0
 public void AddressExtremeMax()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //boolean variable to store the result of the validation
     Boolean OK = false;
     //create some test data to assign to the property
     string SomeAddress = "";
     //pad the string with a character
     SomeAddress = SomeAddress.PadRight(500, 'a');
     //invoke the method
     OK = AInvoice.Valid(SomeAddress);
     //test to see that the result is correct
     Assert.IsFalse(OK);
 }
Ejemplo n.º 6
0
 public void AddressMaxPlusOne()
 {
     //create an instance of the class we want to create
     clsInvoice AInvoice = new clsInvoice();
     //boolean variable to store the result of the validation
     Boolean OK = false;
     //create some test data to assign to the property
     string SomeAddress = "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghija";
     //invoke the method
     OK = AInvoice.Valid(SomeAddress);
     //test to see that the result is correct
     Assert.IsFalse(OK);
 }