Exemple #1
0
        public void ReadAll_Create3Records_CountIs3()
        {
            //Assemble
            ProgramTypeModel programTypeModel1 = new ProgramTypeModel();

            programTypeModel1.description = "Advanced";

            ProgramTypeModel programTypeModel2 = new ProgramTypeModel();

            programTypeModel2.description = "Regular";

            ProgramTypeModel programTypeModel3 = new ProgramTypeModel();

            programTypeModel3.description = "Advanced";

            ProgramTypeTable programTypeTable = new ProgramTypeTable();
            int expected = 3;

            //Act
            int programTypeID1             = programTypeTable.create(programTypeModel1);
            int programTypeID2             = programTypeTable.create(programTypeModel2);
            int programTypeID3             = programTypeTable.create(programTypeModel3);
            List <ProgramTypeModel> actual = programTypeTable.readAll();

            //Assert
            Assert.AreEqual(expected, actual.Count);
        }
Exemple #2
0
        public void ReadAll_Create3Records_3DifferentRecords()
        {
            //Assemble
            ProgramTypeModel programTypeModel1 = new ProgramTypeModel();

            programTypeModel1.description = "Advanced";

            ProgramTypeModel programTypeModel2 = new ProgramTypeModel();

            programTypeModel2.description = "Regular";

            ProgramTypeModel programTypeModel3 = new ProgramTypeModel();

            programTypeModel3.description = "Advanced";

            ProgramTypeTable programTypeTable = new ProgramTypeTable();

            //Act
            int programTypeID1             = programTypeTable.create(programTypeModel1);
            int programTypeID2             = programTypeTable.create(programTypeModel2);
            int programTypeID3             = programTypeTable.create(programTypeModel3);
            List <ProgramTypeModel> actual = programTypeTable.readAll();

            //Assert
            Assert.AreEqual(programTypeID1, programTypeID1);
            Assert.AreEqual(programTypeModel1.description, actual[0].description);

            Assert.AreEqual(programTypeID2, programTypeID2);
            Assert.AreEqual(programTypeModel2.description, actual[1].description);

            Assert.AreEqual(programTypeID3, programTypeID3);
            Assert.AreEqual(programTypeModel3.description, actual[2].description);
        }