示例#1
0
        protected override void EstablishContext()
        {
            base.EstablishContext();

            staffStudentAssociationRepository = mocks.StrictMock<IRepository<StaffStudentAssociation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            currentUserClaimInterrogator = mocks.StrictMock<ICurrentUserClaimInterrogator>();

            windsorContainer = new WindsorContainer();
            RegisterProviders(windsorContainer);

            userEntryProvider = windsorContainer.Resolve<IUserEntryProvider>();

            Expect.Call(staffStudentAssociationRepository.GetAll()).Repeat.Any().Return(GetStaffStudentAssociations());
            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForSchool(suppliedSchoolId)).Repeat.Any().Return(new MetricMetadataNode (new TestMetricMetadataTree()) {MetricId = suppliedMetricId});

            Thread.CurrentPrincipal = suppliedUserInformation.ToClaimsPrincipal();
        }
示例#2
0
        protected override void EstablishContext()
        {
            base.EstablishContext();

            staffStudentAssociationRepository = mocks.StrictMock<IRepository<StaffStudentAssociation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            currentUserClaimInterrogator = mocks.StrictMock<ICurrentUserClaimInterrogator>();
            windsorContainer = new WindsorContainer();
            RegisterProviders(windsorContainer);

            userEntryProvider = windsorContainer.Resolve<IUserEntryProvider>();

            var suppliedUserInformation = new UserInformation
                                                {
                                                    StaffUSI = suppliedStaffUSI,
                                                    AssociatedOrganizations = new List<UserInformation.EducationOrganization>()
                                                                                {
                                                                                    new UserInformation.School(suppliedLocalEducationAgencyId, suppliedSchoolId)
                                                                                        {
                                                                                            ClaimTypes = new List<string>
                                                                                                                {
                                                                                                                    EdFiClaimTypes.ViewAllTeachers
                                                                                                                }
                                                                                        }
                                                                                }
                                                };
            Thread.CurrentPrincipal = suppliedUserInformation.ToClaimsPrincipal();
        }