コード例 #1
0
ファイル: AgencyFactory.cs プロジェクト: girish66/REM
        /// <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);
        }
コード例 #2
0
ファイル: AgencyFactory.cs プロジェクト: divyang4481/REM
        /// <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;
        }
コード例 #3
0
ファイル: AgencyFactory.cs プロジェクト: girish66/REM
        /// <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);
        }
コード例 #4
0
ファイル: AgencyTests.cs プロジェクト: divyang4481/REM
        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);
            }
        }
コード例 #5
0
ファイル: AgencyFactory.cs プロジェクト: divyang4481/REM
        /// <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;
        }
コード例 #6
0
        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;
        }