public void InsetTextSetCorrectlyForNoPreviouslySignedAgreements(int agreementVersion, string expectedResult)
        {
            var model = new AgreementTemplateViewModel
            {
                VersionNumber = agreementVersion
            };

            Assert.AreEqual(expectedResult, model.InsetText(new List <OrganisationAgreementViewModel>()));
        }
        public void InsetTextSetCorrectlyForPreviouslySignedv3Agreements(int agreementVersion, string expectedResult)
        {
            var model = new AgreementTemplateViewModel
            {
                VersionNumber = agreementVersion
            };

            var agreements = new List <OrganisationAgreementViewModel>
            {
                new OrganisationAgreementViewModel
                {
                    SignedDate = DateTime.Today,
                    Template   = new AgreementTemplateViewModel
                    {
                        VersionNumber = 3
                    }
                }
            };

            Assert.AreEqual(expectedResult, model.InsetText(agreements));
        }
Exemplo n.º 3
0
        public static string InsetText(this AgreementTemplateViewModel agreementTemplate, ICollection <OrganisationAgreementViewModel> organisationAgreementViewModel)
        {
            switch (agreementTemplate.VersionNumber)
            {
            case 1:
                return(string.Empty);

            case 2:
                return("This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).");

            case 3:
                return("This is a new agreement.");

            case 4:
                return(HasSignedVariationOfv3Agreement(organisationAgreementViewModel) ? "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice." : "This is a new agreement.");

            case 5:
                return(HasSignedVariationOfv3Agreement(organisationAgreementViewModel) ? "This is a variation to the agreement we published 9 January 2020." : "This is a new agreement.");

            default:
                return(string.Empty);
            }
        }