예제 #1
0
        protected override void EstablishContext()
        {
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            suppliedMetricMetadataTree = GetSuppliedMetadataTree();

            providerToTest = new MetricStateProvider(metricMetadataTreeService);
        }
예제 #2
0
 public MetricGoalProvider(IMetricMetadataTreeService metricMetadataNodeService, IMetricGoalsService metricGoalsService, 
     IMetricInstancesService metricInstancesService)
 {
     this.metricMetadataNodeService = metricMetadataNodeService;
     this.metricGoalsService = metricGoalsService;
     this.metricInstancesService = metricInstancesService;
 }
 public DomainSpecificMetricNodeResolver(IEdFiDashboardContextProvider dashboardContextProvider,
     IMetricMetadataTreeService metricMetadataTreeService,
     IRootMetricNodeResolver rootMetricNodeResolver)
 {
     this.dashboardContextProvider = dashboardContextProvider;
     this.metricMetadataTreeService = metricMetadataTreeService;
     this.rootMetricNodeResolver = rootMetricNodeResolver;
 }
예제 #4
0
 public RootMetricNodeResolver(IEdFiDashboardContextProvider dashboardContextProvider, 
     IMetricMetadataTreeService metricMetadataTreeService, 
     ISchoolCategoryProvider schoolCategoryProvider)
 {
     this.schoolCategoryProvider = schoolCategoryProvider;
     this.metricMetadataTreeService = metricMetadataTreeService;
     this.dashboardContextProvider = dashboardContextProvider;
 }
예제 #5
0
        protected override void EstablishContext()
        {
            metricGoalsService = mocks.StrictMock<IMetricGoalsService>();
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            metricInstancesService = mocks.StrictMock<IMetricInstancesService>();
            cacheProvider = mocks.StrictMock<ICacheProvider>();

            suppliedMetricGoalData = GetSuppliedMetricGoalData();
            suppliedMetricMetadataTree = GetSuppliedMetaDataNode();
            suppliedMetricInstanceData = GetSuppliedMetricInstance();
        }
예제 #6
0
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedMetadataTree = GetSuppliedMetricMetadataTree();

            //Set up the mocks
            dashboardContextProvider = mocks.StrictMock<IEdFiDashboardContextProvider>();
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();

            //Set expectations
            Expect.Call(metricMetadataTreeService.Get(null)).IgnoreArguments().Return(suppliedMetadataTree);
        }
        protected override void EstablishContext()
        {
            SetSuppliedGoal();

            localEducationAgencyMetricSchoolListRepository = mocks.StrictMock<IRepository<LocalEducationAgencyMetricSchoolList>>();
            staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>();
            schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>();
            uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>();
            metricCorrelationService = mocks.StrictMock<IMetricCorrelationProvider>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<LocalEducationAgencyMetricInstanceSetRequest>>();
            metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            metricMetadataNodeService = mocks.StrictMock<IMetricMetadataTreeService>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();

            suppliedLocalEducationAgencyMetricSchoolList = GetSuppliedLocalEducationAgencyMetricSchoolList();
            suppliedStaffInformationList = GetSuppliedStaffInformationRepository();
            suppliedSchoolInformationList = GetSuppliedSchoolInformationRepository();

            Expect.Call(metricNodeResolver.GetMetricNodeForLocalEducationAgencyMetricVariantId(suppliedMetricVariantId)).Return(GetSuppliedMetricMetadataNode());
            Expect.Call(localEducationAgencyMetricSchoolListRepository.GetAll()).Repeat.Any().Return(suppliedLocalEducationAgencyMetricSchoolList);
            Expect.Call(staffInformationRepository.GetAll()).Repeat.Any().Return(suppliedStaffInformationList);
            Expect.Call(schoolInformationRepository.GetAll()).Return(suppliedSchoolInformationList);
            Expect.Call(uniqueListIdProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedListContext);
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<LocalEducationAgencyMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.MetricVariantId == suppliedMetricVariantId);
                        Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId);
                    })
                ).Return(suppliedMetricInstanceSetKey);
            Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedGoal);

            var tree = new TestMetricMetadataTree();
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(1, suppliedGranularCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedGranularCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(2, suppliedContainerCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedContainerCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(3, suppliedContainerCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedContainerCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(5, suppliedAggregateCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedAggregateCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });

            Expect.Call(metricMetadataNodeService.Get(MetricMetadataTreeRequest.Create())).IgnoreArguments().Repeat.Any().Return(GetRootNode());
            SetupMetricCorrelationService();
        }
예제 #8
0
        protected override void EstablishContext()
        {

            suppliedMetricInstanceSetRequest = new SomeMetricInstanceSetRequest { MetricVariantId = suppliedMetricVariantId };
            //mock data services return
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            Expect.Call(metricMetadataTreeService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricMetadataTree());

            metricDataService = mocks.StrictMock<IMetricDataService<SomeMetricInstanceSetRequest>>();
            Expect.Call(metricDataService.Get(suppliedMetricInstanceSetRequest)).Return(GetSuppliedMetricData());

            metricInstanceTreeFactory = mocks.StrictMock<IMetricInstanceTreeFactory>();

            Expect.Call(metricInstanceTreeFactory.CreateTree(suppliedMetricInstanceSetRequest, null, null))
                .IgnoreArguments()
                .Return(GetSuppliedMetricInstanceTree());


            var suppliedMetricNode = new MetricMetadataNode(new TestMetricMetadataTree()) { MetricNodeId = suppliedMetricNodeId };
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            Expect.Call(metricNodeResolver.ResolveFromMetricVariantId(suppliedMetricVariantId)).Return(suppliedMetricNode);
        }
예제 #9
0
 public MetricMetadataController(IMetricMetadataTreeService metricMetadataTreeService)
 {
     this.metricMetadataTreeService = metricMetadataTreeService;
 }
예제 #10
0
 public MetricStateProvider(IMetricMetadataTreeService metricMetadataTreeService)
 {
     this.metricMetadataTreeService = metricMetadataTreeService;
 }
예제 #11
0
 public HomeController(IHomeService service, IMetricMetadataTreeService metricMetadataTreeService)
 {
     this.service = service;
     this.metricMetadataTreeService = metricMetadataTreeService;
 }
예제 #12
0
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedMetricData = GetSuppliedMetricData();
            suppliedMetricMetadataTree = GetSuppliedMetricMetadataTree();

            //Set up the mocks
            metricMetadataNodeService = mocks.StrictMock<IMetricMetadataTreeService>();
            metricGoalsService = mocks.StrictMock<IMetricGoalsService>();
            metricInstancesService = mocks.StrictMock<IMetricInstancesService>();
            cacheProvider = mocks.StrictMock<ICacheProvider>();
        }