public void AddParticipantTest() { ManageController controller = new ManageController(); AssignedListing test = new AssignedListing(); test.ListingId = 1; test.UserId = 5; //Check that the AddParticipant function completed successfully Assert.AreEqual(controller.AddParticipant(test), "Assignment Added"); //Check that the assignment was actually added to the database AssignedListing lastAdded = controller.ReturnLastAddedAssignment(); Assert.IsTrue( lastAdded.ListingId == test.ListingId && lastAdded.UserId == test.UserId); }
public void RemoveParticipantTest() { ManageController controller = new ManageController(); //Deleting the assignment that was added in previous test AssignedListing test = controller.ReturnLastAddedAssignment(); //Check that the RemoveParticipant function completed successfully Assert.AreEqual(controller.RemoveParticipant(test), "Assignment Removed"); //Check that the assignment was actually deleted from the database AssignedListing lastAdded = controller.ReturnLastAddedAssignment(); //*This assert may fail even though the assignment was removed Assert.IsFalse( lastAdded.ListingId == test.ListingId && lastAdded.UserId == test.UserId); }