public void TestConfigDefaultWorks() { var cmdlet = new TestGCloudCmdlet(); cmdlet.TestBeginProcessing(); Assert.AreEqual(CloudSdkSettings.GetDefaultProject(), cmdlet.Project); }
public void TestGetDefaultProject() { // This test requires the default project has actually been set. Run `gcloud init` // after a fresh install if necessary. string defaultProject = CloudSdkSettings.GetDefaultProject(); Assert.IsNotNull(defaultProject); }
public void TestGetOptInSetting() { // Just assert this doesn't throw, depending on the install the // value could be true or false. CloudSdkSettings.GetOptIntoUsageReporting(); // Same with above. If the user opted into settings (and has ran // the Python bits at least once) the value will be stable. // Otherwise it will be different each time. CloudSdkSettings.GetAnoymousClientID(); }
public void TestGetConfigurationFilePath() { string currentConfigName = CloudSdkSettings.GetCurrentConfigurationName(); // If this fails it is most likely because gcloud is not installed on the machine. Assert.IsNotNull(currentConfigName); string configFilePath = CloudSdkSettings.GetCurrentConfigurationFilePath(); Assert.IsNotNull(configFilePath); Assert.IsTrue(File.Exists(configFilePath)); }
private static IReportCmdletResults NewTelemetryReporter() { if (CloudSdkSettings.GetOptIntoUsageReporting()) { string clientID = CloudSdkSettings.GetAnoymousClientID(); return(new GoogleAnalyticsCmdletReporter(clientID, AnalyticsEventCategory.ProviderInvocation)); } else { return(new InMemoryCmdletResultReporter()); } }