/// <summary> /// Creates the agency. /// </summary> /// <param name="agencyProfile"> /// The agency profile. /// </param> /// <returns> /// An Agency. /// </returns> public Agency CreateAgency(AgencyProfile agencyProfile) { Check.IsNotNull(agencyProfile, "agencyProfile is required."); Agency agency = new AgencyBuilder().WithAgencyProfile(agencyProfile); _agencyRepository.MakePersistent(agency); return(agency); }
/// <summary> /// Creates the agency. /// </summary> /// <param name="agencyProfile"> /// The agency profile. /// </param> /// <returns> /// An Agency. /// </returns> public Agency CreateAgency(AgencyProfile agencyProfile) { Check.IsNotNull(agencyProfile, "agencyProfile is required."); Agency agency = new AgencyBuilder().WithAgencyProfile(agencyProfile); _agencyRepository.MakePersistent(agency); return agency; }
/// <summary> /// Creates the child agency. /// </summary> /// <param name="agencyProfile"> /// The agency profile. /// </param> /// <param name="parentAgency"> /// The parent agency. /// </param> /// <returns> /// An Agency. /// </returns> public Agency CreateChildAgency(AgencyProfile agencyProfile, Agency parentAgency) { Check.IsNotNull(agencyProfile, "agencyProfile is required."); Check.IsNotNull(parentAgency, "parentAgency is required."); Agency agency = new AgencyBuilder().WithAgencyProfile(agencyProfile).WithPatentAgency(parentAgency); _agencyRepository.MakePersistent(agency); return(agency); }
public void ReviseAgencyProfile_LegalNameChangeSuccessful() { using (var serviceLocatorFixture = new ServiceLocatorFixture()) { //Setup SetupServiceLocatorFixture(serviceLocatorFixture); const string newName = "ADifferentName"; var agencyType = new Mock<AgencyType>(); Agency agency = new AgencyBuilder().WithAgencyProfile( new AgencyProfileBuilder().WithAgencyType(agencyType.Object).WithAgencyName(new AgencyNameBuilder().WithLegalName("SomeName"))); agency.ReviseAgencyProfile( new AgencyProfileBuilder().WithAgencyType(agencyType.Object).WithAgencyName( new AgencyNameBuilder().WithLegalName(newName))); Assert.AreEqual(agency.AgencyProfile.AgencyName.LegalName, newName); } }
/// <summary> /// Creates the child agency. /// </summary> /// <param name="agencyProfile"> /// The agency profile. /// </param> /// <param name="parentAgency"> /// The parent agency. /// </param> /// <returns> /// An Agency. /// </returns> public Agency CreateChildAgency(AgencyProfile agencyProfile, Agency parentAgency) { Check.IsNotNull(agencyProfile, "agencyProfile is required."); Check.IsNotNull(parentAgency, "parentAgency is required."); Agency agency = new AgencyBuilder().WithAgencyProfile(agencyProfile).WithPatentAgency(parentAgency); _agencyRepository.MakePersistent(agency); return agency; }
private Agency BuildAgency(AgencyType agencyType, string legalName, string displayName = null) { Agency agency = new AgencyBuilder().WithAgencyProfile( new AgencyProfileBuilder().WithAgencyType(agencyType).WithAgencyName( new AgencyNameBuilder().WithLegalName(legalName).WithDisplayName(displayName))); Session.SaveOrUpdate(agency); return agency; }