public DataModelBuilder WithStageWorkflowFor(Release release, Stage stage) { var stageWorkflow = new StageWorkflowBuilder() .ForRelease(release) .ForStage(stage) .Build(); _stageWorkflows.Add(stageWorkflow); return this; }
internal static void AssertAreStagesEqual(Stage expectedStage, Models.Environment expectedEnvironment, dynamic actualStage) { Assert.AreEqual(expectedStage.Id, actualStage.id, "Unexpected id for stage"); Assert.AreEqual(expectedStage.Name, actualStage.name, "Unexpected name for stage with id {0}", expectedStage.Id); Assert.AreEqual(expectedStage.Rank, actualStage.rank, "Unexpected rank for stage with id {0}", expectedStage.Id); Assert.AreEqual(expectedEnvironment.Name, actualStage.environment, "Unexpected environment for stage with id {0}", expectedStage.Id); }
private static dynamic CreateStage(Stage stageData, List<Models.Environment> environments) { dynamic stage = new ExpandoObject(); stage.id = stageData.Id; stage.name = stageData.Name; stage.rank = stageData.Rank; var environmentData = environments.First(env => env.Id == stageData.EnvironmentId); stage.environment = environmentData.Name; return stage; }
public DataModelBuilder WithStage(Stage stage) { _stages.Add(stage); return this; }