public void SetUp() { _request = new CompanyDetailsRequest("companyName", "can", "address1", "address2", "address3", "address4", "postcode", "tel", "website", "mainContact", "actioningUser", "businessSafeContact"); var employee = new EmployeeForAuditing() { Forename = "George", Surname = "Best", Id = Guid.NewGuid() }; _request.ExistingCompanyDetails = new Application.Request.CompanyDetailsInformation() { AddressLine1 = "existing address line 1", AddressLine2 = "existing address line 2", AddressLine3 = "existing address line 3", AddressLine4 = "existing address line 4", CompanyName = "existing CompanyName", MainContact = "existing MainContact", Postcode = "existing PostCode", Telephone = "existing Telephone", Website = "existing Website", BusinessSafeContactId = employee.Id, BusinessSafeContactName = employee.FullName }; ; _bus = new Mock<IBus>(); _log = new Mock<IPeninsulaLog>(); ObjectFactory.Inject<IPeninsulaLog>(new StubPeninsulaLog()); }
public EmployeeForAuditingDto Map(EmployeeForAuditing employeeForAuditing) { if (employeeForAuditing == null) return null; var dto = new EmployeeForAuditingDto { Id = employeeForAuditing.Id, Forename = employeeForAuditing.Forename, Surname = employeeForAuditing.Surname, FullName = employeeForAuditing.FullName }; return dto; }
public void Setup() { _employeeForAuditingRepository = new Mock<IEmployeeForAuditingRepository>(); _businessSafeCompanyDetailRepository = new Mock<IBusinessSafeCompanyDetailRepository>(); _userForAuditingRepository = new Mock<IUserForAuditingRepository>(); _companyId = 1234L; _employee = new EmployeeForAuditing() { Id = Guid.NewGuid(), Forename = "Denis", Surname = "Irwin" }; _companyDetails = new BusinessSafeCompanyDetail() { CompanyId = _companyId, BusinessSafeContactEmployee = _employee }; _request = new CompanyDetailsRequest { Id = default(long), CAN = "can", NewCompanyDetails = new CompanyDetailsInformation() { AddressLine1 = "address line 1", AddressLine2 = "address line 2", AddressLine3 = "address line 3", AddressLine4 = "address line 4", CompanyName = "CompanyName", MainContact = "MainContact", Postcode = "PostCode", Telephone = "Telephone", Website = "Website", BusinessSafeContactId = _employee.Id, BusinessSafeContactName = _employee.FullName } }; _businessSafeCompanyDetailRepository .Setup(x => x.GetByCompanyId(It.IsAny<long>())) .Returns(_companyDetails); _employeeForAuditingRepository .Setup(x => x.GetByIdAndCompanyId(It.IsAny<Guid>(), It.IsAny<long>())) .Returns(_employee); _employeeForAuditingRepository .Setup(x => x.GetByIdAndCompanyIdWithoutChecking(It.IsAny<Guid>(), It.IsAny<long>())) .Returns(_employee); _userForAuditingRepository .Setup(x => x.GetByIdAndCompanyId(It.IsAny<Guid>(), It.IsAny<long>())) .Returns(_user); _log = new Mock<IPeninsulaLog>(); _log.Setup(x => x.Add(It.IsAny<object>())); _target = GetTarget(); }