public UploadAzureCloudServicePackageConvention(ICalamariFileSystem fileSystem, IAzurePackageUploader azurePackageUploader,
     ISubscriptionCloudCredentialsFactory credentialsFactory)
 {
     this.fileSystem = fileSystem;
     this.azurePackageUploader = azurePackageUploader;
     this.credentialsFactory = credentialsFactory;
 }
        public void SetUp()
        {
            fileSystem = Substitute.For<ICalamariFileSystem>();
            packageUploader = Substitute.For<IAzurePackageUploader>();
            credentialsFactory = Substitute.For<ISubscriptionCloudCredentialsFactory>();
            credentialsFactory.GetCredentials(azureSubscriptionId, certificateThumbprint, certificateBytes)
                .Returns(new FakeSubscriptionCloudCredentials(azureSubscriptionId));

            variables = new VariableDictionary();
            variables.Set(SpecialVariables.OriginalPackageDirectoryPath, stagingDirectory);
            variables.Set(SpecialVariables.Action.Azure.SubscriptionId, azureSubscriptionId);
            variables.Set(SpecialVariables.Action.Azure.CertificateThumbprint, certificateThumbprint);
            variables.Set(SpecialVariables.Action.Azure.CertificateBytes, certificateBytes);
            variables.Set(SpecialVariables.Action.Azure.StorageAccountName, storageAccountName);
            deployment = new RunningDeployment(stagingDirectory, variables);

            convention = new UploadAzureCloudServicePackageConvention(fileSystem, packageUploader, credentialsFactory);
        }
        public void SetUp()
        {
            result = null;

            fileSystem = Substitute.For<ICalamariFileSystem>();
            credentialsFactory = Substitute.For<ISubscriptionCloudCredentialsFactory>();
            configurationRetriever = Substitute.For<IAzureCloudServiceConfigurationRetriever>();
            variables = new VariableDictionary();
            variables.Set(SpecialVariables.OriginalPackageDirectoryPath, StagingDirectory);
            deployment = new RunningDeployment(StagingDirectory, variables);

            variables.Set(SpecialVariables.Action.Azure.SubscriptionId, AzureSubscriptionId);
            variables.Set(SpecialVariables.Action.Azure.CertificateThumbprint, CertificateThumbprint);
            variables.Set(SpecialVariables.Action.Azure.CertificateBytes, CertificateBytes);
            variables.Set(SpecialVariables.Action.Azure.CloudServiceName, CloudServiceName);
            variables.Set(SpecialVariables.Action.Azure.Slot, DeploymentSlot.ToString());

            credentialsFactory.GetCredentials(AzureSubscriptionId, CertificateThumbprint, CertificateBytes)
                .Returns(new FakeSubscriptionCloudCredentials(AzureSubscriptionId));

            convention = new ConfigureAzureCloudServiceConvention(fileSystem, credentialsFactory, configurationRetriever);
        }
 public ConfigureAzureCloudServiceConvention(ICalamariFileSystem fileSystem, ISubscriptionCloudCredentialsFactory subscriptionCloudCredentialsFactory, IAzureCloudServiceConfigurationRetriever configurationRetriever)
 {
     this.fileSystem = fileSystem;
     this.credentialsFactory = subscriptionCloudCredentialsFactory;
     this.configurationRetriever = configurationRetriever;
 }