public void TryParseDeploymentInfoShouldReturnProcessDeployment() { var oneDriveHandler = new OneDriveHandler(Mock.Of <ITracer>(), Mock.Of <IDeploymentStatusManager>(), Mock.Of <IDeploymentSettingsManager>(), Mock.Of <IEnvironment>(), Mock.Of <IRepositoryFactory>()); JObject payload = JObject.FromObject(new { RepositoryUrl = "https://api.onedrive.com", AccessToken = "one-drive-access-token" }); DeploymentInfoBase 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>(), Mock.Of <IRepositoryFactory>()); JObject payload = JObject.FromObject(new { }); DeploymentInfoBase deploymentInfo = null; DeployAction result = oneDriveHandler.TryParseDeploymentInfo(null, payload, null, out deploymentInfo); Assert.Equal(DeployAction.UnknownPayload, result); }