Ejemplo n.º 1
0
        public void AddHPIDetail_Success()
        {
            //Arrange
            Mock_PresentIllness();
            var addHPIDetail = new PresentIllnessDetailModel
            {
                HPIDetailID   = 57,
                HPIID         = 1,
                Comment       = "Some comment",
                Location      = "SOme location",
                Quality       = "Living with Family.",
                HPISeverityID = 1,
                Duration      = " Some duration",
                Timing        = "Some  timing",
                Context       = "Some context",
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                ForceRollback = true
            };
            //Act
            var addHPIResult = PresentIllnessController.AddHPIDetail(addHPIDetail);
            var response     = addHPIResult as HttpResult <Response <PresentIllnessDetailModel> >;

            //Assert
            Assert.IsNotNull(response, "Response can't be null");
            Assert.IsNotNull(response.Value, "Response value can't be null");
            Assert.IsNotNull(response.Value.DataItems, "Response value can't be null");
            Assert.IsTrue(response.Value.DataItems.Count == 2, "HPI Details could not be saved.");
        }
        public void AddHPIDetail_Success()
        {
            //Arrange
            var srModel = new PresentIllnessDetailViewModel
            {
                HPIDetailID   = 57,
                HPIID         = 1,
                Comment       = "Some comment",
                Location      = "SOme location",
                Quality       = "Living with Family.",
                HPISeverityID = 1,
                Duration      = " Some duration",
                Timing        = "Some  timing",
                Context       = "Some context",
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                ForceRollback = true
            };
            // Act
            var response = controller.AddHPIDetail(srModel);

            // Assert
            Assert.IsNotNull(response, "Response can not be null");
            Assert.IsTrue(response.ID > 0, "HPI Detail could not be created.");
        }