public void Update_CreatedUpdateAndRead1Record_UpdatedValues() { //Assemble EnrollmentModel enrollmentModel = new EnrollmentModel(); enrollmentModel.programId = programId; enrollmentModel.clientId = clientId; enrollmentModel.dogId = dogId; enrollmentModel.programId = programId; EnrollmentTable enrollmentTable = new EnrollmentTable(); int enrollmentID = enrollmentTable.create(enrollmentModel); enrollmentModel.id = enrollmentID; enrollmentModel.programId = programId; enrollmentModel.clientId = clientId; enrollmentModel.dogId = dogId; enrollmentModel.programId = programId; //Act enrollmentTable.update(enrollmentModel); EnrollmentModel actual = enrollmentTable.read(enrollmentID); //Assert Assert.AreEqual(enrollmentModel.programId, actual.programId); Assert.AreEqual(enrollmentModel.clientId, actual.clientId); Assert.AreEqual(enrollmentModel.dogId, actual.dogId); Assert.AreEqual(enrollmentModel.programId, actual.programId); }
public void Update_CreatedUpdateAndRead1Record_UpdatedValues() { //Assemble EnrollmentModel enrollmentModel = new EnrollmentModel(); enrollmentModel.programId = programId; enrollmentModel.clientId = clientId; enrollmentModel.dogId = dogId; enrollmentModel.programId = programId; enrollmentModel.paymentMethod = 1; enrollmentModel.name = "Advanced"; enrollmentModel.joinDate = DateTime.Now; enrollmentModel.inviteIssued = false; EnrollmentTable enrollmentTable = new EnrollmentTable(); int enrollmentID = enrollmentTable.create(enrollmentModel); enrollmentModel.id = enrollmentID; enrollmentModel.programId = programId; enrollmentModel.clientId = clientId; enrollmentModel.dogId = dogId; enrollmentModel.programId = programId; enrollmentModel.paymentMethod = 2; enrollmentModel.name = "Regular"; enrollmentModel.joinDate = DateTime.Now; enrollmentModel.inviteIssued = true; //Act enrollmentTable.update(enrollmentModel); EnrollmentModel actual = enrollmentTable.read(enrollmentID); //Assert Assert.AreEqual(enrollmentModel.programId, actual.programId); Assert.AreEqual(enrollmentModel.clientId, actual.clientId); Assert.AreEqual(enrollmentModel.dogId, actual.dogId); Assert.AreEqual(enrollmentModel.programId, actual.programId); Assert.AreEqual(enrollmentModel.joinDate.DayOfYear, actual.joinDate.DayOfYear); Assert.AreEqual(enrollmentModel.inviteIssued, actual.inviteIssued); }