public void TestLastNameSpaceStringValid() { // Generate a new staff object with the factory clsStaff staff = new clsStaffFactory().MakeNewStaffObj(); // Should already be a valid object // Hold an empty string to simulate error string string error = ""; staff.last_name = " "; // Call the test method error = staff.Valid(staff.salary, staff.first_name, staff.last_name, staff.active); Assert.AreNotEqual("", error); }
public void TestValidSalaryNegative() { // Generate a new staff object with the factory clsStaff staff = new clsStaffFactory().MakeNewStaffObj(); // Hold an empty string to simulate error string string error = ""; // Set salary on object staff.salary = -100; // Call the test method error = staff.Valid(staff.salary, staff.first_name, staff.last_name, staff.active); Assert.AreNotEqual("", error); }
public void TestValidPass() { // Generate a new staff object with the factory clsStaff staff = new clsStaffFactory().MakeNewStaffObj(); // Should already be a valid object // Hold an empty string to simulate error string string error = ""; // Call the test method error = staff.Valid(staff.salary, staff.first_name, staff.last_name, staff.active); if (error != "") { Console.WriteLine("Test failed with " + error); } Assert.AreEqual("", error); }