public void ReadAll_Create3Records_3DifferentRecords() { //Assemble WaitingListModel waitingListModel1 = new WaitingListModel(); waitingListModel1.clientId = clientId; waitingListModel1.dogId = dogId; waitingListModel1.programTypeId = programTypeId; waitingListModel1.joinDate = new DateTime(2003, 01, 06); waitingListModel1.inviteIssued = false; WaitingListModel waitingListModel2 = new WaitingListModel(); waitingListModel2.clientId = clientId; waitingListModel2.dogId = dogId; waitingListModel2.programTypeId = programTypeId; waitingListModel2.joinDate = new DateTime(2003, 01, 06); waitingListModel2.inviteIssued = false; WaitingListModel waitingListModel3 = new WaitingListModel(); waitingListModel3.clientId = clientId; waitingListModel3.dogId = dogId; waitingListModel3.programTypeId = programTypeId; waitingListModel3.joinDate = new DateTime(2003, 01, 06); waitingListModel3.inviteIssued = false; WaitingListTable waitingListTable = new WaitingListTable(); //Act int waitingListID1 = waitingListTable.create(waitingListModel1); int waitingListID2 = waitingListTable.create(waitingListModel2); int waitingListID3 = waitingListTable.create(waitingListModel3); List <WaitingListModel> actual = waitingListTable.readAll(); //Assert Assert.AreEqual(waitingListID1, waitingListID1); Assert.AreEqual(waitingListModel1.dogId, actual[0].dogId); Assert.AreEqual(waitingListModel1.programTypeId, actual[0].programTypeId); Assert.AreEqual(waitingListModel1.joinDate, actual[0].joinDate); Assert.AreEqual(waitingListModel1.inviteIssued, actual[0].inviteIssued); Assert.AreEqual(waitingListID2, waitingListID2); Assert.AreEqual(waitingListModel2.dogId, actual[1].dogId); Assert.AreEqual(waitingListModel2.programTypeId, actual[1].programTypeId); Assert.AreEqual(waitingListModel2.joinDate, actual[1].joinDate); Assert.AreEqual(waitingListModel2.inviteIssued, actual[1].inviteIssued); Assert.AreEqual(waitingListID3, waitingListID3); Assert.AreEqual(waitingListModel3.dogId, actual[2].dogId); Assert.AreEqual(waitingListModel3.programTypeId, actual[2].programTypeId); Assert.AreEqual(waitingListModel3.joinDate, actual[2].joinDate); Assert.AreEqual(waitingListModel3.inviteIssued, actual[2].inviteIssued); }
public void ReadAll_Create3Records_CountIs3() { //Assemble WaitingListModel waitingListModel1 = new WaitingListModel(); waitingListModel1.clientId = clientId; waitingListModel1.dogId = dogId; waitingListModel1.programTypeId = programTypeId; waitingListModel1.joinDate = new DateTime(2003, 01, 06); waitingListModel1.inviteIssued = false; WaitingListModel waitingListModel2 = new WaitingListModel(); waitingListModel2.clientId = clientId; waitingListModel2.dogId = dogId; waitingListModel2.programTypeId = programTypeId; waitingListModel2.joinDate = new DateTime(2003, 01, 06); waitingListModel2.inviteIssued = false; WaitingListModel waitingListModel3 = new WaitingListModel(); waitingListModel3.clientId = clientId; waitingListModel3.dogId = dogId; waitingListModel3.programTypeId = programTypeId; waitingListModel3.joinDate = new DateTime(2003, 01, 06); waitingListModel3.inviteIssued = false; WaitingListTable waitingListTable = new WaitingListTable(); int expected = 3; //Act int waitingListID1 = waitingListTable.create(waitingListModel1); int waitingListID2 = waitingListTable.create(waitingListModel2); int waitingListID3 = waitingListTable.create(waitingListModel3); List <WaitingListModel> actual = waitingListTable.readAll(); //Assert Assert.AreEqual(expected, actual.Count); }