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 | |
Результат | DeployAction |
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); }
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); }