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