public SubmissionMetricsRepositoryFixture()
        {
            var fixture = new Fixture();

            fixture.Behaviors
            .OfType <ThrowingRecursionBehavior>()
            .ToList()
            .ForEach(b => fixture.Behaviors.Remove(b));
            fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            jobId                          = fixture.Create <long>();
            academicYear                   = fixture.Create <short>();
            currentCollectionPeriod        = fixture.Create <byte>();
            persistenceDataContext         = new InMemoryMetricsPersistenceDataContext();
            metricsQueryDataContextFactory = new Mock <IMetricsQueryDataContextFactory>();
            logger                         = new Mock <IPaymentLogger>();
            sut = new SubmissionMetricsRepository(persistenceDataContext, metricsQueryDataContextFactory.Object, logger.Object);

            matchingSubmissionSummaries    = fixture.Create <List <SubmissionSummaryModel> >();
            nonMatchingSubmissionSummaries = fixture.Create <List <SubmissionSummaryModel> >();

            matchingSubmissionSummaries.ForEach(x =>
            {
                x.AcademicYear     = academicYear;
                x.CollectionPeriod = currentCollectionPeriod;
            });
        }
Ejemplo n.º 2
0
        public GetCollectionPeriodToleranceFixture()
        {
            var fixture = new Fixture();

            academicYear                   = fixture.Create <short>();
            collectionPeriod               = fixture.Create <byte>();
            persistenceDataContext         = new InMemoryMetricsPersistenceDataContext();
            metricsQueryDataContextFactory = new Mock <IMetricsQueryDataContextFactory>();
            logger = new Mock <IPaymentLogger>();
            sut    = new SubmissionMetricsRepository(persistenceDataContext, metricsQueryDataContextFactory.Object, logger.Object);

            matchingCollectionPeriodToleranceModel = fixture.Create <CollectionPeriodToleranceModel>();
            matchingCollectionPeriodToleranceModel.AcademicYear     = academicYear;
            matchingCollectionPeriodToleranceModel.CollectionPeriod = collectionPeriod;
            nonMatchingCollectionPeriodToleranceModels = fixture.Create <List <CollectionPeriodToleranceModel> >();
        }