Ejemplo n.º 1
0
        public void ReadAll_Create3Records_CountIs3()
        {
            //Assemble
            StaffModel staffModel1 = new StaffModel();

            staffModel1.name = "Bob";

            StaffModel staffModel2 = new StaffModel();

            staffModel2.name = "Bob2";

            StaffModel staffModel3 = new StaffModel();

            staffModel3.name = "Bob3";

            StaffTable staffTable = new StaffTable();
            int        expected   = 3;

            //Act
            int staffID1             = staffTable.create(staffModel1);
            int staffID2             = staffTable.create(staffModel2);
            int staffID3             = staffTable.create(staffModel3);
            List <StaffModel> actual = staffTable.readAll();

            //Assert
            Assert.AreEqual(expected, actual.Count);
        }
Ejemplo n.º 2
0
        public void ReadAll_Create3Records_3DifferentRecords()
        {
            //Assemble
            StaffModel staffModel1 = new StaffModel();

            staffModel1.name = "name1";


            StaffModel staffModel2 = new StaffModel();

            staffModel2.name = "name2";

            StaffModel staffModel3 = new StaffModel();

            staffModel3.name = "name3";

            StaffTable staffTable = new StaffTable();

            //Act
            int staffID1             = staffTable.create(staffModel1);
            int staffID2             = staffTable.create(staffModel2);
            int staffID3             = staffTable.create(staffModel3);
            List <StaffModel> actual = staffTable.readAll();

            //Assert
            Assert.AreEqual(staffID1, staffID1);
            Assert.AreEqual(staffModel1.name, actual[0].name);

            Assert.AreEqual(staffID2, staffID2);
            Assert.AreEqual(staffModel2.name, actual[1].name);

            Assert.AreEqual(staffID3, staffID3);
            Assert.AreEqual(staffModel3.name, actual[2].name);
        }