public void UpdateHPI_Success()
        {
            //Act
            Mock_PresentIllness();
            var updateHPI = new PresentIllnessModel
            {
                HPIID         = 1,
                ContactID     = 1,
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                IsActive      = true,
                ModifiedBy    = 5,
                ModifiedOn    = DateTime.Now,
                ForceRollback = true
            };
            var updateHPIResult = PresentIllnessController.UpdateHPI(updateHPI);
            var response        = updateHPIResult as HttpResult <Response <PresentIllnessModel> >;

            //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");
        }
Ejemplo n.º 2
0
        public void UpdateHPI_Success()
        {
            // Act
            var srModel = new PresentIllnessViewModel
            {
                HPIID         = 1,
                ContactID     = 1,
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                ForceRollback = true
            };

            var response = controller.UpdateHPI(srModel);

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