Esempio n. 1
0
        public void Update_CreatedUpdateAndRead1Record_UpdatedValues()
        {
            //Assemble
            ProgramVarietyModel programVarietyModel = new ProgramVarietyModel();

            programVarietyModel.depositAmount = 49.0;
            programVarietyModel.sessionCost   = 50.0;
            programVarietyModel.fullPaymentPercentageDiscount = 51.0;
            programVarietyModel.name             = "Regular";
            programVarietyModel.noOfClasses      = 10;
            programVarietyModel.dogSpacesMaximum = 9;

            ProgramVarietyTable programCostTable = new ProgramVarietyTable();
            int programCostID = programCostTable.create(programVarietyModel);

            programVarietyModel.id            = programCostID;
            programVarietyModel.depositAmount = 49.1;
            programVarietyModel.sessionCost   = 50.1;
            programVarietyModel.fullPaymentPercentageDiscount = 51.4;
            programVarietyModel.noOfClasses      = 8;
            programVarietyModel.dogSpacesMaximum = 7;

            //Act
            programCostTable.update(programVarietyModel);
            ProgramVarietyModel actual = programCostTable.read(programCostID);

            //Assert
            Assert.AreEqual(programVarietyModel.depositAmount, actual.depositAmount);
            Assert.AreEqual(programVarietyModel.sessionCost, actual.sessionCost);
            Assert.AreEqual(programVarietyModel.fullPaymentPercentageDiscount, actual.fullPaymentPercentageDiscount);
            Assert.AreEqual(programVarietyModel.dogSpacesMaximum, actual.dogSpacesMaximum);
            Assert.AreEqual(programVarietyModel.noOfClasses, actual.noOfClasses);
        }
Esempio n. 2
0
        public void Read_CreatedAndRead1Record_CorrectValues()
        {
            //Assemble
            ProgramVarietyModel programVarietyModel = new ProgramVarietyModel();

            programVarietyModel.depositAmount = 49.0;
            programVarietyModel.sessionCost   = 50.0;
            programVarietyModel.fullPaymentPercentageDiscount = 51.0;
            programVarietyModel.name             = "Advanced";
            programVarietyModel.noOfClasses      = 10;
            programVarietyModel.dogSpacesMaximum = 9;
            ProgramVarietyTable programCostTable = new ProgramVarietyTable();

            //Act
            int programCostID          = programCostTable.create(programVarietyModel);
            ProgramVarietyModel actual = programCostTable.read(programCostID);

            //Assert
            Assert.AreEqual(programVarietyModel.depositAmount, actual.depositAmount);
            Assert.AreEqual(programVarietyModel.sessionCost, actual.sessionCost);
            Assert.AreEqual(programVarietyModel.dogSpacesMaximum, actual.dogSpacesMaximum);
            Assert.AreEqual(programVarietyModel.noOfClasses, actual.noOfClasses);
        }