protected override void EstablishContext() { LeaContextProvider = mocks.StrictMock<ILocalEducationAgencyContextProvider>(); LocalEducationAgencyApplicationRepository = mocks.StrictMock<IRepository<EdFi.Dashboards.Application.Data.Entities.LocalEducationAgency>>(); LocalEducationAgencyApplicationAuthRepository = mocks.StrictMock<IRepository<Dashboards.Application.Data.Entities.LocalEducationAgencyAuthentication>>(); Expect.Call(LeaContextProvider.GetCurrentLocalEducationAgencyCode()).Repeat.Any().Return("1"); Expect.Call(LocalEducationAgencyApplicationRepository.GetAll()).Repeat.Any().Return(new List<Dashboards.Application.Data.Entities.LocalEducationAgency> { new Dashboards.Application.Data.Entities.LocalEducationAgency { LocalEducationAgencyId = 1, Name = "Test", Code = "1" } }.AsQueryable()); Expect.Call(LocalEducationAgencyApplicationAuthRepository.GetAll()).Repeat.Any().Return(new List<Dashboards.Application.Data.Entities.LocalEducationAgencyAuthentication> { new LocalEducationAgencyAuthentication { LocalEducationAgencyId = 1, StaffInformationLookupKey = ExpectedValue, LdapLookupKey = string.Empty } }.AsQueryable()); base.EstablishContext(); }
protected override void EstablishContext() { schoolMetricInstanceTeacherListRepository = mocks.StrictMock<IRepository<SchoolMetricInstanceTeacherList>>(); staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>(); staffEdOrgRepository = mocks.StrictMock<IRepository<StaffEducationOrgInformation>>(); uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>(); metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>(); staffLinks = mocks.StrictMock<IStaffAreaLinks>(); codeIdProvider = mocks.StrictMock<ICodeIdProvider>(); localEducationAgencyContextProvider = mocks.StrictMock<ILocalEducationAgencyContextProvider>(); warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>(); maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>(); Expect.Call(warehouseAvailabilityProvider.Get()).Return(suppliedWarehouseAvailability); if (suppliedWarehouseAvailability) { Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(-1, -1)).IgnoreArguments().Return(GetMetricMetadataNode()); Expect.Call(localEducationAgencyContextProvider.GetCurrentLocalEducationAgencyCode()).Return("Code"); Expect.Call(codeIdProvider.Get("Code")).Return(1); Expect.Call(maxPriorYearProvider.Get(1)).Return(2012); Expect.Call(schoolMetricInstanceTeacherListRepository.GetAll()).Return(GetSuppliedSchoolMetricInstanceTeacherList()); Expect.Call(uniqueListProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedUniqueId); if (isStaffCountGreaterThanZero) { Expect.Call(staffEdOrgRepository.GetAll()).Return(GetSuppliedStaffEdOrg()); Expect.Call(staffInformationRepository.GetAll()).Return(GetStaffInformation()); Expect.Call(staffLinks.Default(-1, -1, string.Empty, null, null, null)).IgnoreArguments().Return(string.Empty); } } base.EstablishContext(); }