示例#1
0
        public void ReadAll_Create3Records_CountIs3()
        {
            //Assemble
            ProgramModel programModel1 = new ProgramModel();

            programModel1.programVarietyId = programVarietyId;


            ProgramModel programModel2 = new ProgramModel();

            programModel2.programVarietyId = programVarietyId;


            ProgramModel programModel3 = new ProgramModel();

            programModel3.programVarietyId = programVarietyId;


            ProgramTable programTable = new ProgramTable();
            int          expected     = 3;

            //Act
            int programID1             = programTable.create(programModel1);
            int programID2             = programTable.create(programModel2);
            int programID3             = programTable.create(programModel3);
            List <ProgramModel> actual = programTable.readAll();

            //Assert
            Assert.AreEqual(expected, actual.Count);
        }
示例#2
0
        public void ReadAll_Create3Records_3DifferentRecords()
        {
            //Assemble
            ProgramModel programModel1 = new ProgramModel();

            programModel1.programTypeId    = programTypeId;
            programModel1.programCostId    = programCostId;
            programModel1.dogSpacesMaximum = 10;
            programModel1.noOfClasses      = 6;

            ProgramModel programModel2 = new ProgramModel();

            programModel2.programTypeId    = programTypeId;
            programModel2.programCostId    = programCostId;
            programModel2.dogSpacesMaximum = 10;
            programModel2.noOfClasses      = 6;

            ProgramModel programModel3 = new ProgramModel();

            programModel3.programTypeId    = programTypeId;
            programModel3.programCostId    = programCostId;
            programModel3.dogSpacesMaximum = 10;
            programModel3.noOfClasses      = 6;

            ProgramTable programTable = new ProgramTable();

            //Act
            int programID1             = programTable.create(programModel1);
            int programID2             = programTable.create(programModel2);
            int programID3             = programTable.create(programModel3);
            List <ProgramModel> actual = programTable.readAll();

            //Assert
            Assert.AreEqual(programID1, actual[0].id);
            Assert.AreEqual(programModel1.programTypeId, actual[0].programTypeId);
            Assert.AreEqual(programModel1.programCostId, actual[0].programCostId);
            Assert.AreEqual(programModel1.dogSpacesMaximum, actual[0].dogSpacesMaximum);
            Assert.AreEqual(programModel1.noOfClasses, actual[0].noOfClasses);

            Assert.AreEqual(programID2, actual[1].id);
            Assert.AreEqual(programModel2.programTypeId, actual[1].programTypeId);
            Assert.AreEqual(programModel2.programCostId, actual[1].programCostId);
            Assert.AreEqual(programModel2.dogSpacesMaximum, actual[1].dogSpacesMaximum);
            Assert.AreEqual(programModel2.noOfClasses, actual[1].noOfClasses);

            Assert.AreEqual(programID3, actual[2].id);
            Assert.AreEqual(programModel3.programTypeId, actual[2].programTypeId);
            Assert.AreEqual(programModel3.programCostId, actual[2].programCostId);
            Assert.AreEqual(programModel3.dogSpacesMaximum, actual[2].dogSpacesMaximum);
            Assert.AreEqual(programModel3.noOfClasses, actual[2].noOfClasses);
        }
示例#3
0
        public void ReadAll_Create3Records_CountIs3()
        {
            //Assemble
            ProgramModel programModel1 = new ProgramModel();

            programModel1.programTypeId    = programTypeId;
            programModel1.programCostId    = programCostId;
            programModel1.dogSpacesMaximum = 10;
            programModel1.noOfClasses      = 6;

            ProgramModel programModel2 = new ProgramModel();

            programModel2.programTypeId    = programTypeId;
            programModel2.programCostId    = programCostId;
            programModel2.dogSpacesMaximum = 10;
            programModel2.noOfClasses      = 6;

            ProgramModel programModel3 = new ProgramModel();

            programModel3.programTypeId    = programTypeId;
            programModel3.programCostId    = programCostId;
            programModel3.dogSpacesMaximum = 10;
            programModel3.noOfClasses      = 6;

            ProgramTable programTable = new ProgramTable();
            int          expected     = 3;

            //Act
            int programID1             = programTable.create(programModel1);
            int programID2             = programTable.create(programModel2);
            int programID3             = programTable.create(programModel3);
            List <ProgramModel> actual = programTable.readAll();

            //Assert
            Assert.AreEqual(expected, actual.Count);
        }
示例#4
0
        public void ReadAll_Create3Records_3DifferentRecords()
        {
            //Assemble
            ProgramModel programModel1 = new ProgramModel();

            programModel1.programVarietyId = programVarietyId;


            ProgramModel programModel2 = new ProgramModel();

            programModel2.programVarietyId = programVarietyId;


            ProgramModel programModel3 = new ProgramModel();

            programModel3.programVarietyId = programVarietyId;


            ProgramTable programTable = new ProgramTable();

            //Act
            int programID1             = programTable.create(programModel1);
            int programID2             = programTable.create(programModel2);
            int programID3             = programTable.create(programModel3);
            List <ProgramModel> actual = programTable.readAll();

            //Assert
            Assert.AreEqual(programID1, actual[0].id);
            Assert.AreEqual(programModel1.programVarietyId, actual[0].programVarietyId);

            Assert.AreEqual(programID2, actual[1].id);
            Assert.AreEqual(programModel2.programVarietyId, actual[1].programVarietyId);

            Assert.AreEqual(programID3, actual[2].id);
            Assert.AreEqual(programModel3.programVarietyId, actual[2].programVarietyId);
        }