Beispiel #1
0
        public void Testupdate()
        {
            foreach (var answer in _answerValues)
            {
                var answerRecord = AnswerRepository.GetAnswer(answer.ConsumerHistoryId, answer.QuestionId);

                AnswerRepository.UpdateAnswer(answerRecord.AnswerID, answer.Updatednewvalue);

                Assert.AreEqual(1234, answer.ConsumerHistoryId);
                Assert.AreEqual(answer.Updatednewvalue, answerRecord.Answer);
            }

            foreach (var consumerupdatevalues in _consumervalues)
            {
                var consumervalue = ConsumerRepository.GetConsumerId(consumerupdatevalues.FN, consumerupdatevalues.LN);
                ConsumerRepository.UpdateConsumer(consumervalue.ConsumerID, consumerupdatevalues.Update_MlAddr1,
                                                  consumerupdatevalues.Update_SSN);

                Assert.AreEqual(consumervalue.FN, consumerupdatevalues.FN);
                Assert.AreEqual("Mctest", consumervalue.LN);
            }

            foreach (var consumerHistoryupdatevalues in _consumerHistoryvalues)
            {
                var consumerHistoryIdvalue =
                    ConsumerHistoryRepository.GetConsumerHistoryId(consumerHistoryupdatevalues.ConsumerID,
                                                                   consumerHistoryupdatevalues.EventID);
                ConsumerHistoryRepository.UpdateConsumerHistory(consumerHistoryIdvalue.ConsumerHistoryID,
                                                                consumerHistoryupdatevalues.Update_WeightInLbs, consumerHistoryupdatevalues.Update_LDL);
                Assert.AreEqual(100, consumerHistoryIdvalue.LDL);
            }
        }
Beispiel #2
0
        public void TestInsert()
        {
            //Insert to tables
            foreach (var answer in _answerValues)
            {
                AnswerRepository.AddNewAnswerRow(answer);
            }

            foreach (var consumerdata in _consumervalues)
            {
                ConsumerRepository.AddNewConsumerRow(consumerdata);
            }

            foreach (var consumerHistoryvalues in _consumerHistoryvalues)
            {
                ConsumerHistoryRepository.AddNewConsumerHistoryRow(consumerHistoryvalues);
            }
        }