示例#1
0
        public void Read_CreatedAndRead1Record_CorrectValues()
        {
            //Assemble
            EnrollmentModel enrollmentModel = new EnrollmentModel();

            enrollmentModel.programId     = programId;
            enrollmentModel.clientId      = clientId;
            enrollmentModel.dogId         = dogId;
            enrollmentModel.programId     = programId;
            enrollmentModel.paymentMethod = 2;
            enrollmentModel.name          = "Advanced";
            enrollmentModel.joinDate      = DateTime.Now;
            enrollmentModel.inviteIssued  = true;
            EnrollmentTable enrollmentTable = new EnrollmentTable();

            //Act
            int             enrollmentID = enrollmentTable.create(enrollmentModel);
            EnrollmentModel actual       = enrollmentTable.read(enrollmentID);

            //Assert
            Assert.AreEqual(enrollmentModel.programId, actual.programId);
            Assert.AreEqual(enrollmentModel.clientId, actual.clientId);
            Assert.AreEqual(enrollmentModel.dogId, actual.dogId);
            Assert.AreEqual(enrollmentModel.programId, actual.programId);
            Assert.AreEqual(enrollmentModel.name, actual.name);
            Assert.AreEqual(enrollmentModel.joinDate.DayOfYear, actual.joinDate.DayOfYear);
            Assert.AreEqual(enrollmentModel.inviteIssued, actual.inviteIssued);
        }
示例#2
0
        public void Update_CreatedUpdateAndRead1Record_UpdatedValues()
        {
            //Assemble
            EnrollmentModel enrollmentModel = new EnrollmentModel();

            enrollmentModel.programId = programId;
            enrollmentModel.clientId  = clientId;
            enrollmentModel.dogId     = dogId;
            enrollmentModel.programId = programId;
            EnrollmentTable enrollmentTable = new EnrollmentTable();
            int             enrollmentID    = enrollmentTable.create(enrollmentModel);

            enrollmentModel.id        = enrollmentID;
            enrollmentModel.programId = programId;
            enrollmentModel.clientId  = clientId;
            enrollmentModel.dogId     = dogId;
            enrollmentModel.programId = programId;

            //Act
            enrollmentTable.update(enrollmentModel);
            EnrollmentModel actual = enrollmentTable.read(enrollmentID);

            //Assert
            Assert.AreEqual(enrollmentModel.programId, actual.programId);
            Assert.AreEqual(enrollmentModel.clientId, actual.clientId);
            Assert.AreEqual(enrollmentModel.dogId, actual.dogId);
            Assert.AreEqual(enrollmentModel.programId, actual.programId);
        }