示例#1
0
        public void UpdateHPIDetail_Success()
        {
            //Arrange
            Mock_PresentIllness();
            var updateHPIDetail = new PresentIllnessDetailModel
            {
                HPIDetailID   = 57,
                HPIID         = 1,
                Comment       = "Some reasonable comment",
                Location      = "SOme different 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 updateHPIResult = PresentIllnessController.UpdateHPIDetail(updateHPIDetail);
            var response        = updateHPIResult 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, "DataItems can't be null");
            Assert.IsTrue(response.Value.DataItems.Count > 0, "Response must return data items");
        }
        public void UpdateHPIDetail_Success()
        {
            //Arrange
            var srModel = new PresentIllnessDetailViewModel
            {
                HPIDetailID   = 57,
                HPIID         = 1,
                Comment       = "Some reasonable comment",
                Location      = "SOme different 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.UpdateHPIDetail(srModel);

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