public void ServiceDeliveryOrganisationTypeRefDataService_Update_CallSaveChanges() { #region Arrange var component = new ServiceDeliveryOrganisationTypeRefData() { Id = 4, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation MJJ", }; #endregion #region Act _serviceDeliveryOrganisationRefDataService.Update(component); #endregion #region Assert _serviceDeliveryOrganisationTypeRefDataRepository.Verify(x => x.Update(It.IsAny <ServiceDeliveryOrganisationTypeRefData>()), Times.Once()); _unitOfWork.Verify(x => x.Save(), Times.Exactly(1)); #endregion }
public void ServiceDeliveryOrganisationTypeRefDataService_Create_CallSaveChanges() { #region Arrange var resolverGroup = new ServiceDeliveryOrganisationTypeRefData() { Id = 5, ServiceDeliveryOrganisationTypeName = "Resolver MJJ", SortOrder = 5 }; #endregion #region Act var response = _serviceDeliveryOrganisationRefDataService.Create(resolverGroup); #endregion #region Assert _serviceDeliveryOrganisationTypeRefDataRepository.Verify(x => x.Insert(It.IsAny <ServiceDeliveryOrganisationTypeRefData>()), Times.Once()); _unitOfWork.Verify(x => x.Save(), Times.Exactly(1)); Assert.IsNotNull(response); Assert.AreEqual(5, response); #endregion }
public void Delete(ServiceDeliveryOrganisationTypeRefData entity) { RetryableOperation.Invoke(ExceptionPolicies.General, () => { _serviceDeliveryOrganisationRefDataRepository.Delete(entity); _unitOfWork.Save(); }); }
public int Create(ServiceDeliveryOrganisationTypeRefData entity) { RetryableOperation.Invoke(ExceptionPolicies.General, () => { _serviceDeliveryOrganisationRefDataRepository.Insert(entity); _unitOfWork.Save(); }); return(entity.Id); }
public ServiceDeliveryOrganisationTypeRefData GetById(int id) { ServiceDeliveryOrganisationTypeRefData result = null; RetryableOperation.Invoke(ExceptionPolicies.General, () => { result = _serviceDeliveryOrganisationRefDataRepository.GetById(id); }); return(result); }
public void ServiceDeliveryOrganisationTypeRefDataService_Delete_CallSaveChanges() { #region Arrange var resolverGroup = new ServiceDeliveryOrganisationTypeRefData() { Id = 4, }; #endregion #region Act _serviceDeliveryOrganisationRefDataService.Delete(resolverGroup); #endregion #region Assert _serviceDeliveryOrganisationTypeRefDataRepository.Verify(x => x.Delete(It.IsAny <ServiceDeliveryOrganisationTypeRefData>()), Times.Once()); _unitOfWork.Verify(x => x.Save(), Times.Exactly(1)); #endregion }