TryParseDeploymentInfo() public method

public TryParseDeploymentInfo ( System.Web.HttpRequestBase request, Newtonsoft.Json.Linq.JObject payload, string targetBranch, Kudu.Services.ServiceHookHandlers.DeploymentInfo &deploymentInfo ) : DeployAction
request System.Web.HttpRequestBase
payload Newtonsoft.Json.Linq.JObject
targetBranch string
deploymentInfo Kudu.Services.ServiceHookHandlers.DeploymentInfo
return DeployAction
Exemplo n.º 1
0
        public void TryParseDeploymentInfoShouldReturnProcessDeployment()
        {
            var oneDriveHandler = new OneDriveHandler(Mock.Of<ITracer>(), Mock.Of<IDeploymentStatusManager>(), Mock.Of<IDeploymentSettingsManager>(), Mock.Of<IEnvironment>());
            JObject payload = JObject.FromObject(new { RepositoryUrl = "https://api.onedrive.com", AccessToken = "one-drive-access-token" });
            DeploymentInfo deploymentInfo = null;

            DeployAction result = oneDriveHandler.TryParseDeploymentInfo(null, payload, null, out deploymentInfo);
            Assert.Equal(DeployAction.ProcessDeployment, result);
        }
Exemplo n.º 2
0
        public void TryParseDeploymentInfoShouldReturnUnknownPayload()
        {
            var oneDriveHandler = new OneDriveHandler(Mock.Of<ITracer>(), Mock.Of<IDeploymentStatusManager>(), Mock.Of<IDeploymentSettingsManager>(), Mock.Of<IEnvironment>());
            JObject payload = JObject.FromObject(new { });
            DeploymentInfo deploymentInfo = null;

            DeployAction result = oneDriveHandler.TryParseDeploymentInfo(null, payload, null, out deploymentInfo);
            Assert.Equal(DeployAction.UnknownPayload, result);
        }