コード例 #1
0
        public async void testAllowableChangesRule_SimpleDissallowedChange_SimpleProperty()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.PreferredFirstName = "BIG CHANGES";

            await AssertAllowableChanges(false, enrollee, profile);
        }
コード例 #2
0
        public async void testAllowableChangesRule_SimpleDissallowedChange_RemoveChildObject()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.MailingAddress = null;

            await AssertAllowableChanges(false, enrollee, profile);
        }
コード例 #3
0
        public async void testAllowableChangesRule_SimpleDissallowedChange_PropertyOnChildObject()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.MailingAddress.City = "Flavortown, USA";

            await AssertAllowableChanges(false, enrollee, profile);
        }
コード例 #4
0
        public async void testAllowableChangesRule_Jobs(bool?isObo, bool expected)
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();

            // Set the enrollee's user class via the access term
            if (isObo.HasValue)
            {
                enrollee.AccessTerms = new[]
                {
                    new AccessTerm
                    {
                        AcceptedDate = DateTimeOffset.Now,
                        UserClause   = new UserClause {
                            EnrolleeClassification = isObo == true ? PrimeConstants.PRIME_OBO : PrimeConstants.PRIME_RU
                        }
                    }
                };
            }
            else
            {
                enrollee.AccessTerms = new AccessTerm[] { };
            }

            // New job
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.Jobs.Add(new Job {
                Title = "Snake sweater knitter"
            });
            await AssertAllowableChanges(expected, enrollee, profile);

            // Edit job
            profile = enrollee.ToViewModel();
            profile.Jobs.First().Title = "Bespoke lifehack crafter";
            await AssertAllowableChanges(expected, enrollee, profile);

            // Remove job
            profile      = enrollee.ToViewModel();
            profile.Jobs = profile.Jobs.Skip(1).ToList();
            await AssertAllowableChanges(expected, enrollee, profile);
        }
コード例 #5
0
        public async void testAllowableChangesRule_AllowedUpdates()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.ContactEmail   += "change";
            profile.ContactPhone   += "change";
            profile.VoicePhone     += "change";
            profile.VoiceExtension += "change";

            await AssertAllowableChanges(true, enrollee, profile);
        }
コード例 #6
0
        public async void testAllowableChangesRule_EnrolleeOrganizationTypes()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();

            // New org
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.EnrolleeOrganizationTypes.Add(new EnrolleeOrganizationType {
                OrganizationTypeCode = 1
            });
            await AssertAllowableChanges(false, enrollee, profile);

            // Edit org
            profile = enrollee.ToViewModel();
            profile.EnrolleeOrganizationTypes.First().OrganizationTypeCode++;
            await AssertAllowableChanges(false, enrollee, profile);

            // Remove org
            profile = enrollee.ToViewModel();
            profile.EnrolleeOrganizationTypes = profile.EnrolleeOrganizationTypes.Skip(1).ToList();
            await AssertAllowableChanges(false, enrollee, profile);
        }
コード例 #7
0
        public async void testAllowableChangesRule_Certifications()
        {
            Enrollee enrollee = TestUtils.EnrolleeFaker.Generate();

            // New cert
            EnrolleeProfileViewModel profile = enrollee.ToViewModel();

            profile.Certifications.Add(new Certification {
                CollegeCode = 1
            });
            await AssertAllowableChanges(false, enrollee, profile);

            // Edit cert
            profile = enrollee.ToViewModel();
            profile.Certifications.First().LicenseNumber += "6";
            await AssertAllowableChanges(false, enrollee, profile);

            // Remove cert
            profile = enrollee.ToViewModel();
            profile.Certifications = profile.Certifications.Skip(1).ToList();
            await AssertAllowableChanges(false, enrollee, profile);
        }