public void Setup() { _companyId = 1234L; _companyDetails = new BusinessSafeCompanyDetail() { CompanyId = _companyId, BusinessSafeContactEmployee = new EmployeeForAuditing() { Id = Guid.NewGuid(), Forename = "Denis", Surname = "Irwin", } }; _businessSafeCompanyDetailRepository = new Mock<IBusinessSafeCompanyDetailRepository>(); _businessSafeCompanyDetailRepository .Setup(x => x.GetByCompanyId(It.IsAny<long>())) .Returns(_companyDetails); _log = new Mock<IPeninsulaLog>(); _log.Setup(x => x.Add(It.IsAny<object>())); _target = GetTarget(); }
public BusinessSafeCompanyDetailDto Map(BusinessSafeCompanyDetail entity) { return new BusinessSafeCompanyDetailDto() { BusinessSafeContactEmployeeFullName = entity.BusinessSafeContactEmployee.FullName, BusinessSafeContactEmployeeId = entity.BusinessSafeContactEmployee.Id }; }
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(); }