public async Task FunctionalDeletePoolIdTest() { var batchService = new BatchService(ConfigurationHelper.GetConfiguration()); var controller = ControllerExtensions.NewCloudController(); // Create a json body with a specific pool id var jsonBody = new DeletePoolApiJsonBody { PoolId = "TEST_RENDERING" }; var result = await controller.DeletePool((JObject)JToken.FromObject(jsonBody)); Assert.IsInstanceOfType(result, typeof(HttpResponseMessage)); Assert.IsTrue(result.IsSuccessStatusCode); var pool = batchService.GetPoolsInBatch(); Assert.IsTrue(pool?.FirstOrDefault(p => p.Id == jsonBody.PoolId).State == Microsoft.Azure.Batch.Common.PoolState.Deleting); }
public async Task FunctionalEndToEndCreateTest() { var batchService = new BatchService(ConfigurationHelper.GetConfiguration()); Assert.IsTrue(string.IsNullOrWhiteSpace(batchService.HasValidConfiguration())); var controller = ControllerExtensions.NewCloudController(); // Create a fully functional json body var jsonBody = new CreateApiJsonBody { TurnPoolId = "TEST_TURN", RenderingPoolId = "TEST_RENDERING" }; var result = await controller.Post((JObject)JToken.FromObject(jsonBody)); Assert.IsInstanceOfType(result, typeof(HttpResponseMessage)); var pool = batchService.GetPoolsInBatch(); Assert.IsNotNull(pool.FirstOrDefault(p => p.Id == jsonBody.TurnPoolId)); Assert.IsNotNull(pool.FirstOrDefault(p => p.Id == jsonBody.RenderingPoolId)); }