Пример #1
0
        protected override void GivenTheOtherwiseValidVariationContext(Action <ProviderVariationContext> changes = null)
        {
            base.GivenTheOtherwiseValidVariationContext(changes);

            PublishedProvider publishedProvider =
                VariationContext.GetPublishedProviderOriginalSnapShot(VariationContext.ProviderId);

            if (publishedProvider == null)
            {
                return;
            }

            PublishedProviderVersion publishedProviderCurrent = publishedProvider.Current;

            publishedProviderCurrent.FundingLines = new[]
            {
                NewFundingLine(_ => _.WithFundingLineCode(FundingLineCode)
                               .WithFundingLineType(FundingLineType.Payment)
                               .WithValue(new RandomNumberBetween(1, int.MaxValue))
                               .WithDistributionPeriods(NewDistributionPeriod(dp =>
                                                                              dp.WithProfilePeriods(NewProfilePeriod()))))
            };
            publishedProviderCurrent.Provider = NewProvider();

            publishedProvider.Released = publishedProviderCurrent.DeepCopy();
        }
Пример #2
0
        public void GivenTheFollowingPublishedProviderHasBeenPreviouslyGeneratedForTheCurrentSpecification(Table table)
        {
            PublishedProviderVersion publishedProviderVersion = table.CreateInstance <PublishedProviderVersion>();

            publishedProviderVersion.SpecificationId = _currentSpecificationStepContext.SpecificationId;

            PublishedProvider publishedProvider = new PublishedProvider()
            {
                Current = publishedProviderVersion,
            };

            if (publishedProviderVersion.Status == PublishedProviderStatus.Released)
            {
                publishedProvider.Released = publishedProviderVersion.DeepCopy();
            }

            _publishedFundingRepositoryStepContext.CurrentPublishedProvider = publishedProvider;
        }