public void TestRenderMissingPropertyShouldFail() { var template = @"name: (( Name )) na: (( DoesNotExist ))"; var job = new JobWithoutAzureResourceDeployment { Name = "TestJob", Template = template }; Action act = () => job.Render(); act.Should().Throw <Exception>(); }
public void TestRenderMultiplePropertiesSameLine() { var template = @"name: (( TemplateInclude )).(( Name )) chaos: (( ChaosEnabled ))"; var job = new JobWithoutAzureResourceDeployment { Name = "TestJob", ChaosEnabled = true, Template = template }; job.Render(); var lines = job.Rendered.ToList(); lines.Count().Should().Be(2); lines[0].Should().Be("name: env-job-template.TestJob"); lines[1].Should().Be("chaos: true"); }
public void TestRenderUnsetProperty() { var template = @"name: (( Name )) command: (( Command )) chaos: (( ChaosEnabled ))"; var job = new JobWithoutAzureResourceDeployment { Name = "TestJob", ChaosEnabled = true, Template = template }; Action act = () => job.Render(); job.Render(); var lines = job.Rendered.ToList(); lines.Count().Should().Be(2); lines[0].Should().Be("name: TestJob"); lines[1].Should().Be("chaos: true"); }
public void TestRender() { var template = @"name: (( Name )) command: (( Command )) chaos: (( ChaosEnabled ))"; var job = new JobWithoutAzureResourceDeployment { Name = "TestJob", Command = new List <string> { "sleep", "infinity" }, ChaosEnabled = true, Template = template }; job.Render(); var lines = job.Rendered.ToList(); lines.Count().Should().Be(3); lines[0].Should().Be("name: TestJob"); lines[1].Should().Be("command: [\"sleep\",\"infinity\"]"); lines[2].Should().Be("chaos: true"); }