コード例 #1
0
        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
        }
コード例 #2
0
        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
        }
コード例 #3
0
 public void Delete(ServiceDeliveryOrganisationTypeRefData entity)
 {
     RetryableOperation.Invoke(ExceptionPolicies.General, () =>
     {
         _serviceDeliveryOrganisationRefDataRepository.Delete(entity);
         _unitOfWork.Save();
     });
 }
コード例 #4
0
 public int Create(ServiceDeliveryOrganisationTypeRefData entity)
 {
     RetryableOperation.Invoke(ExceptionPolicies.General, () =>
     {
         _serviceDeliveryOrganisationRefDataRepository.Insert(entity);
         _unitOfWork.Save();
     });
     return(entity.Id);
 }
コード例 #5
0
        public ServiceDeliveryOrganisationTypeRefData GetById(int id)
        {
            ServiceDeliveryOrganisationTypeRefData result = null;

            RetryableOperation.Invoke(ExceptionPolicies.General, () =>
            {
                result = _serviceDeliveryOrganisationRefDataRepository.GetById(id);
            });
            return(result);
        }
コード例 #6
0
        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
        }