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); }
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); }
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); }
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); }
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); }
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); }