BeginCreate() public méthode

public BeginCreate ( DeploymentSlotUri deploymentUri, IDeploymentConfiguration configuration ) : RequestUri
deploymentUri DeploymentSlotUri
configuration IDeploymentConfiguration
Résultat RequestUri
        public void Http409ConflictReturnsNull()
        {
            var http = new ScriptedHttpFake();

            http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.Conflict, ""));

            var api = new AzureManagementLowLevelApi(http);
            var config = MockRepository.GenerateStub<IDeploymentConfiguration>();
            Assert.That(api.BeginCreate(TestDeploymentUri, config), Is.Null, "Should return null on 409 conflict");
        }
        public void ThrowsOnAnythingOtherThanAcceptedAndConflict()
        {
            var http = new ScriptedHttpFake();

            http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.InternalServerError, ""));

            var api = new AzureManagementLowLevelApi(http);
            var config = MockRepository.GenerateStub<IDeploymentConfiguration>();
            Assert.That(
                () => api.BeginCreate(TestDeploymentUri, config),
                Throws.TypeOf<UnhandledHttpException>());
        }
        public void SendsCorrectArguments()
        {
            var http = new ScriptedHttpFake();

            http.Script.Add(() => http.NextResponse = new HttpResponse(HttpStatusCode.Accepted, "", "requestId"));

            var api = new AzureManagementLowLevelApi(http);

            var config = MockRepository.GenerateStub<IDeploymentConfiguration>();
            config.Stub(x => x.MakeCreateDeploymentMessage()).Return("foo");
            var requestUrl = api.BeginCreate(TestDeploymentUri, config);

            Assert.That(http.LastPostUri, Is.EqualTo(TestDeploymentUri.ToString()), "deploymentUri parameter incorrect");
            Assert.That(http.LastPostContent, Is.EqualTo("foo"), "expected xml was passed");

            var expectedRequestUri = TestDeploymentUri.ToRequestUri("requestId");
            Assert.That(requestUrl, Is.EqualTo(expectedRequestUri));
        }