public async Task SkipFirstPresentation_For_StillImage_If_(CostType costType, string contentType, string region, string productionType) { // Arrange var builder = new CreateCostModelBuilder(); if (costType != CostType.Buyout) { builder.WithContentType(contentType); } builder.WithBudgetRegion(region); builder.WithProductionType(productionType); var cost = await CreateCost(builder, AdminUser, costType); // Act var url = $"{CostWorkflowUrl(cost.Id)}/stages"; var response = await Browser.Get(url, w => w.User(AdminUser)); var stageModes = Deserialize <Dictionary <string, StageModel> >(response, HttpStatusCode.OK); // Assert stageModes.Should().HaveCount(4); stageModes.Should().NotContainKeys(CostStages.FirstPresentation.ToString()); stageModes[CostStages.New.ToString()].Transitions.Should().ContainKey(CostStages.FinalActual.ToString()); stageModes[CostStages.OriginalEstimate.ToString()].Transitions.Should().ContainKey(CostStages.FinalActual.ToString()); stageModes[CostStages.OriginalEstimateRevision.ToString()].Transitions.Should().ContainKey(CostStages.FinalActual.ToString()); }
protected async Task <Cost> CreateCost(CreateCostModelBuilder createCostModelBuilder, CostUser user, CostType costType = CostType.Production) { if (!Enum.IsDefined(typeof(CostType), costType)) { throw new ArgumentOutOfRangeException(nameof(costType), "Value should be defined in the CostType enum."); } if (costType == CostType.Production && CostTemplate == null) { CostTemplate = await CreateTemplate(user, costType); } if (costType == CostType.Buyout && UsageCostTemplate == null) { UsageCostTemplate = await CreateTemplate(user, costType); } var costTemplateId = costType == CostType.Production ? CostTemplate.Id : UsageCostTemplate.Id; createCostModelBuilder .WithTemplateId(costTemplateId) .WithAgency(user.Agency.AbstractTypes.FirstOrDefault()); var createCostResult = await CreateCost(user, createCostModelBuilder.Build()); var cost = Deserialize <Cost>(createCostResult, HttpStatusCode.Created); var latestStage = await GetCostLatestStage(cost.Id, user); await GetCostLatestRevision(cost.Id, latestStage.Id, user); return(cost); }