コード例 #1
0
        protected override void EstablishContext()
        {
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            suppliedMetricMetadataTree = GetSuppliedMetadataTree();

            providerToTest = new MetricStateProvider(metricMetadataTreeService);
        }
コード例 #2
0
ファイル: MetricGoalProvider.cs プロジェクト: sybrix/EdFi-App
 public MetricGoalProvider(IMetricMetadataTreeService metricMetadataNodeService, IMetricGoalsService metricGoalsService, 
     IMetricInstancesService metricInstancesService)
 {
     this.metricMetadataNodeService = metricMetadataNodeService;
     this.metricGoalsService = metricGoalsService;
     this.metricInstancesService = metricInstancesService;
 }
コード例 #3
0
 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);
        }
コード例 #7
0
        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
ファイル: HomeController.cs プロジェクト: sybrix/EdFi-App
 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>();
        }