public void ReturnsRunningTransitioningIfRunningTransitioning() { var http = new ScriptedHttpFake(); http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.OK, "<xml><Status>RunningTransitioning</Status></xml>")); var api = new AzureManagementLowLevelApi(http); var status = api.CheckDeploymentStatus(TestDeploymentUri); Assert.That(status, Is.EqualTo(AzureDeploymentCheckOutcome.RunningTransitioning)); }
public void ReturnsFailedOnWebExceptionsNotHandledByHttpGet() { var http = new ScriptedHttpFake(); http.Script.Add(() => { throw new UnhandledHttpException(); }); var api = new AzureManagementLowLevelApi(http); var status = api.CheckDeploymentStatus(TestDeploymentUri); Assert.That(status, Is.EqualTo(AzureDeploymentCheckOutcome.Failed)); }
public void ReturnsNotFoundIfStatusCode404() { var http = new ScriptedHttpFake(); http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.NotFound, "")); var api = new AzureManagementLowLevelApi(http); var status = api.CheckDeploymentStatus(TestDeploymentUri); Assert.That(status, Is.EqualTo(AzureDeploymentCheckOutcome.NotFound)); }
public void SendsCorrectUri() { var http = new ScriptedHttpFake(); http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.OK, "<xml><Status>Suspended</Status></xml>")); var api = new AzureManagementLowLevelApi(http); api.CheckDeploymentStatus(TestDeploymentUri); Assert.That(http.LastGetUri, Is.EqualTo(TestDeploymentUri.ToString())); }