public void InstanceOK() { //create an instance of our class clsItemType clsItemType AItemType = new clsItemType(); //check to see that the class is not null Assert.IsNotNull(AItemType); }
public void ItemTypePropertyOK() { //create an instance f the class we want to create clsItemType AItemType = new clsItemType(); //create some test data to assign to the property string SomeItemType = "Car"; //assign the data to the property AItemType.ItemType = SomeItemType; //test to see that the two values are the same Assert.AreEqual(AItemType.ItemType, SomeItemType); }
public void ItemTypeNoPropertyOK() { //create an instance f the class we want to create clsItemType AItemType = new clsItemType(); //create some test data to assign to the property Int32 TestData = 1; //assign the data to the property AItemType.ItemTypeNo = TestData; //test to see that the two values are the same Assert.AreEqual(AItemType.ItemTypeNo, TestData); }
public void ItemTypeMinBoundary() { //create an instance of the class we want to create clsItemType AItemType = new clsItemType(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string SomeItemType = "aaa"; //this should be ok //invoke the method Error = AItemType.Valid(SomeItemType); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void FindMethodOK() { //create an instance of the class we want to create clsItemType AItemType = new clsItemType(); //boolean variable to store the result of the validation Boolean Found = false; //create some test data to assign to the property Int32 ItemTypeNo = 1; //invoke the method Found = AItemType.Find(ItemTypeNo); //test to see that the result is correct Assert.IsFalse(Found); }
public void ValidMethodOK() { //create an instance of the class we want to create clsItemType AItemType = new clsItemType(); //string variable to store any error message String Error = ""; //create some test data to assign to the property string SomeItemType = "Car"; //invoke the method Error = AItemType.Valid(SomeItemType); //test to see that the result is OK i.e there was no error message returned Assert.AreEqual(Error, ""); }
public void ItemTypeExtremeMax() { //create an instance of the class we want to create clsItemType AItemType = new clsItemType(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string SomeItemType = ""; SomeItemType = SomeItemType.PadRight(50, 'a'); //this should fail //invoke the method Error = AItemType.Valid(SomeItemType); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void CountMatchesList() { //create an instance of the class we want to create clsItemTypeCollection ItemType = new clsItemTypeCollection(); //create some test data to assign to the property //in this case that data needs to be a list of objects List <clsItemType> TestList = new List <clsItemType>(); //add an item to the list //create the item of test data clsItemType TestItemType = new clsItemType(); //set its properties TestItemType.ItemTypeNo = 1; TestItemType.ItemType = "Car"; //add the item to the test list TestList.Add(TestItemType); //assign the data to the property ItemType.AllItemType = TestList; //test to see that the two values are the same Assert.AreEqual(ItemType.Count, TestList.Count); }