Example #1
0
        public async Task GivenIHaveAValidSalesArea()
        {
            var demographic = Fixture.Build <Demographic>()
                              .Without(p => p.Id)
                              .With(p => p.Gameplan, true)
                              .Create();
            var demographics = new List <Demographic>();

            demographics.Add(demographic);
            await _demographicsApi.Create(demographics).ConfigureAwait(false);

            await Task.Delay(GivenSteps.delayForSave).ConfigureAwait(false);

            var salesArea = Fixture.Build <SalesArea>()
                            .With(p => p.BaseDemographic1, demographic.ExternalRef)
                            .With(p => p.BaseDemographic2, demographic.ExternalRef)
                            .With(p => p.StartOffset, Duration.Zero)
                            .With(p => p.DayDuration, Duration.FromHours(1))
                            .Create();

            await Api.Create(salesArea).ConfigureAwait(false);

            await Task.Delay(GivenSteps.delayForSave).ConfigureAwait(false);

            ScenarioContext.Set(salesArea);
        }