public void ReadAll_Create3Records_3DifferentRecords() { //Assemble EnrollmentModel enrollmentModel1 = new EnrollmentModel(); enrollmentModel1.programId = programId; enrollmentModel1.programId = programId; enrollmentModel1.clientId = clientId; enrollmentModel1.dogId = dogId; enrollmentModel1.programId = programId; EnrollmentModel enrollmentModel2 = new EnrollmentModel(); enrollmentModel2.programId = programId; enrollmentModel2.programId = programId; enrollmentModel2.clientId = clientId; enrollmentModel2.dogId = dogId; enrollmentModel2.programId = programId; EnrollmentModel enrollmentModel3 = new EnrollmentModel(); enrollmentModel3.programId = programId; enrollmentModel3.programId = programId; enrollmentModel3.clientId = clientId; enrollmentModel3.dogId = dogId; enrollmentModel3.programId = programId; EnrollmentTable enrollmentTable = new EnrollmentTable(); //Act int enrollmentID1 = enrollmentTable.create(enrollmentModel1); int enrollmentID2 = enrollmentTable.create(enrollmentModel2); int enrollmentID3 = enrollmentTable.create(enrollmentModel3); List <EnrollmentModel> actual = enrollmentTable.readAll(); //Assert Assert.AreEqual(enrollmentID1, enrollmentID1); Assert.AreEqual(enrollmentModel1.programId, actual[0].programId); Assert.AreEqual(enrollmentModel1.clientId, actual[0].clientId); Assert.AreEqual(enrollmentModel1.dogId, actual[0].dogId); Assert.AreEqual(enrollmentModel1.programId, actual[0].programId); Assert.AreEqual(enrollmentID2, enrollmentID2); Assert.AreEqual(enrollmentModel2.programId, actual[1].programId); Assert.AreEqual(enrollmentModel2.clientId, actual[1].clientId); Assert.AreEqual(enrollmentModel2.dogId, actual[1].dogId); Assert.AreEqual(enrollmentModel2.programId, actual[1].programId); Assert.AreEqual(enrollmentID3, enrollmentID3); Assert.AreEqual(enrollmentModel3.programId, actual[2].programId); Assert.AreEqual(enrollmentModel3.clientId, actual[2].clientId); Assert.AreEqual(enrollmentModel3.dogId, actual[2].dogId); Assert.AreEqual(enrollmentModel3.programId, actual[2].programId); }
public void ReadAll_Create3Records_CountIs3() { //Assemble EnrollmentModel enrollmentModel1 = new EnrollmentModel(); enrollmentModel1.programId = programId; enrollmentModel1.programId = programId; enrollmentModel1.clientId = clientId; enrollmentModel1.dogId = dogId; enrollmentModel1.programId = programId; enrollmentModel1.paymentMethod = 1; enrollmentModel1.name = "Advanced"; enrollmentModel1.joinDate = DateTime.Now; enrollmentModel1.inviteIssued = true; EnrollmentModel enrollmentModel2 = new EnrollmentModel(); enrollmentModel2.programId = programId; enrollmentModel2.programId = programId; enrollmentModel2.clientId = clientId; enrollmentModel2.dogId = dogId; enrollmentModel2.programId = programId; enrollmentModel2.paymentMethod = 2; enrollmentModel2.name = "Advanced"; enrollmentModel2.joinDate = DateTime.Now; enrollmentModel2.inviteIssued = true; EnrollmentModel enrollmentModel3 = new EnrollmentModel(); enrollmentModel3.programId = programId; enrollmentModel3.programId = programId; enrollmentModel3.clientId = clientId; enrollmentModel3.dogId = dogId; enrollmentModel3.programId = programId; enrollmentModel3.paymentMethod = 1; enrollmentModel3.name = "Regular"; enrollmentModel3.joinDate = DateTime.Now; enrollmentModel3.inviteIssued = true; EnrollmentTable enrollmentTable = new EnrollmentTable(); int expected = 3; //Act int enrollmentID1 = enrollmentTable.create(enrollmentModel1); int enrollmentID2 = enrollmentTable.create(enrollmentModel2); int enrollmentID3 = enrollmentTable.create(enrollmentModel3); List <EnrollmentModel> actual = enrollmentTable.readAll(); //Assert Assert.AreEqual(expected, actual.Count); }
public void ReadAll_Create3Records_CountIs3() { //Assemble EnrollmentModel enrollmentModel1 = new EnrollmentModel(); enrollmentModel1.programId = programId; enrollmentModel1.programId = programId; enrollmentModel1.clientId = clientId; enrollmentModel1.dogId = dogId; enrollmentModel1.programId = programId; EnrollmentModel enrollmentModel2 = new EnrollmentModel(); enrollmentModel2.programId = programId; enrollmentModel2.programId = programId; enrollmentModel2.clientId = clientId; enrollmentModel2.dogId = dogId; enrollmentModel2.programId = programId; EnrollmentModel enrollmentModel3 = new EnrollmentModel(); enrollmentModel3.programId = programId; enrollmentModel3.programId = programId; enrollmentModel3.clientId = clientId; enrollmentModel3.dogId = dogId; enrollmentModel3.programId = programId; EnrollmentTable enrollmentTable = new EnrollmentTable(); int expected = 3; //Act int enrollmentID1 = enrollmentTable.create(enrollmentModel1); int enrollmentID2 = enrollmentTable.create(enrollmentModel2); int enrollmentID3 = enrollmentTable.create(enrollmentModel3); List <EnrollmentModel> actual = enrollmentTable.readAll(); //Assert Assert.AreEqual(expected, actual.Count); }
public void ReadAll_Create3Records_3DifferentRecords() { //Assemble EnrollmentModel enrollmentModel1 = new EnrollmentModel(); enrollmentModel1.programId = programId; enrollmentModel1.programId = programId; enrollmentModel1.clientId = clientId; enrollmentModel1.dogId = dogId; enrollmentModel1.programId = programId; enrollmentModel1.paymentMethod = 1; enrollmentModel1.name = "Advanced"; enrollmentModel1.joinDate = DateTime.Now; enrollmentModel1.inviteIssued = true; EnrollmentModel enrollmentModel2 = new EnrollmentModel(); enrollmentModel2.programId = programId; enrollmentModel2.programId = programId; enrollmentModel2.clientId = clientId; enrollmentModel2.dogId = dogId; enrollmentModel2.programId = programId; enrollmentModel2.paymentMethod = 2; enrollmentModel2.name = "Advanced"; enrollmentModel2.joinDate = DateTime.Now; enrollmentModel2.inviteIssued = true; EnrollmentModel enrollmentModel3 = new EnrollmentModel(); enrollmentModel3.programId = programId; enrollmentModel3.programId = programId; enrollmentModel3.clientId = clientId; enrollmentModel3.dogId = dogId; enrollmentModel3.programId = programId; enrollmentModel3.paymentMethod = 1; enrollmentModel3.name = "Regular"; enrollmentModel3.joinDate = DateTime.Now; enrollmentModel3.inviteIssued = true; EnrollmentTable enrollmentTable = new EnrollmentTable(); //Act int enrollmentID1 = enrollmentTable.create(enrollmentModel1); int enrollmentID2 = enrollmentTable.create(enrollmentModel2); int enrollmentID3 = enrollmentTable.create(enrollmentModel3); List <EnrollmentModel> actual = enrollmentTable.readAll(); //Assert Assert.AreEqual(enrollmentID1, enrollmentID1); Assert.AreEqual(enrollmentModel1.programId, actual[0].programId); Assert.AreEqual(enrollmentModel1.clientId, actual[0].clientId); Assert.AreEqual(enrollmentModel1.dogId, actual[0].dogId); Assert.AreEqual(enrollmentModel1.programId, actual[0].programId); Assert.AreEqual(enrollmentModel1.paymentMethod, actual[0].paymentMethod); Assert.AreEqual(enrollmentModel1.name, actual[0].name); Assert.AreEqual(enrollmentModel1.joinDate.DayOfYear, actual[0].joinDate.DayOfYear); Assert.AreEqual(enrollmentModel1.inviteIssued, actual[0].inviteIssued); Assert.AreEqual(enrollmentID2, enrollmentID2); Assert.AreEqual(enrollmentModel2.programId, actual[1].programId); Assert.AreEqual(enrollmentModel2.clientId, actual[1].clientId); Assert.AreEqual(enrollmentModel2.dogId, actual[1].dogId); Assert.AreEqual(enrollmentModel2.programId, actual[1].programId); Assert.AreEqual(enrollmentModel2.paymentMethod, actual[1].paymentMethod); Assert.AreEqual(enrollmentModel2.name, actual[1].name); Assert.AreEqual(enrollmentModel2.joinDate.DayOfYear, actual[1].joinDate.DayOfYear); Assert.AreEqual(enrollmentModel2.inviteIssued, actual[1].inviteIssued); Assert.AreEqual(enrollmentID3, enrollmentID3); Assert.AreEqual(enrollmentModel3.programId, actual[2].programId); Assert.AreEqual(enrollmentModel3.clientId, actual[2].clientId); Assert.AreEqual(enrollmentModel3.dogId, actual[2].dogId); Assert.AreEqual(enrollmentModel3.programId, actual[2].programId); Assert.AreEqual(enrollmentModel3.paymentMethod, actual[2].paymentMethod); Assert.AreEqual(enrollmentModel3.name, actual[2].name); Assert.AreEqual(enrollmentModel3.joinDate.DayOfYear, actual[2].joinDate.DayOfYear); Assert.AreEqual(enrollmentModel3.inviteIssued, actual[2].inviteIssued); }