public void GivenValidData_WhenIUpdateADocType_ThenTheDocTypeisUpdated() { var _docTypeService = new DocTypeService(_docTypeRepository.Object); _docTypeService.Update(1, "code", "description"); _docTypeRepository.Verify(p => p.Update(1, "code", "description")); }
public void GivenValidData_AndAnUnavailableDatabase_WhenIUpdateAnSocType_ThenAnUnityExceptionIsThrown() { _docTypeRepository.Setup(p => p.Update(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>())).Throws <Exception>(); var _docTypeService = new DocTypeService(_docTypeRepository.Object); Action act = () => _docTypeService.Update(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>()); act.ShouldThrow <UnityException>(); }