private static TfsSettings ExpectedTfsSettings(bool defaultValues) { TfsSettings settings = new TfsSettings(); if (defaultValues) { // Because the Settings are not an exposed class, just hardcoding the current values for now. We can change if we expect to change values later. settings.TfsServerConnectionString = string.Empty; settings.TfsIgnore = string.Empty; settings.TfsNoLock = string.Empty; settings.ExclusiveCheckoutFileTypes = ".unity|.prefab|.anim|.controller"; settings.IgnoreUsers = string.Empty; settings.ShareBinaryFileCheckout = "$/:false"; settings.LockLevels = "$/:Checkout"; settings.AllowSavingLockedExclusiveFiles = true; } else { settings.TfsServerConnectionString = "https://address.com:port/tfs/ProjectName"; settings.TfsIgnore = "*/Some.dll;*/Some.pdb"; settings.TfsNoLock = "*/Some.prefab;*/SomeOther.prefab"; settings.ExclusiveCheckoutFileTypes = string.Empty; settings.IgnoreUsers = "serviceAccount1|serviceAccount2"; settings.ShareBinaryFileCheckout = "$/:true"; settings.LockLevels = "$/:Checkin"; settings.AllowSavingLockedExclusiveFiles = false; } return(settings); }
public void NoProjectSettingsFile() { TfsSettings expectedTfsSettings = TfsSettingsTests.ExpectedTfsSettings(true); Assert.AreEqual(string.Empty, TfsSettings.Default.LoadedSettingsPath); TfsSettingsTests.AssertSettingsAreEuqal(expectedTfsSettings, TfsSettings.Default); }
protected TfsRestProxyBase( IRestProxy restProxy, ITfsSettingsProvider tfsSettingsProvider) { _restProxy = restProxy; _tfsSettings = tfsSettingsProvider.ProvideTfsSettings(); }
private static TfsSettings GetTfsSetting() { TfsSettings tfsSettings = new TfsSettings(); tfsSettings.Token = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "", ConfigurationManager.AppSettings["personalAccessTokenTfs"]))); tfsSettings.Url = ConfigurationManager.AppSettings["tfsUrl"]; return(tfsSettings); }
public void ProjectSettingsFileWithOverrides() { TfsSettings expectedTfsSettings = TfsSettingsTests.ExpectedTfsSettings(false); TfsSettings.Load(@"TfsSettings\OverrideAllSettings.xml"); Assert.AreEqual(Path.GetFullPath(@"TfsSettings\OverrideAllSettings.xml"), TfsSettings.Default.LoadedSettingsPath); TfsSettingsTests.AssertSettingsAreEuqal(expectedTfsSettings, TfsSettings.Default); }
private static void AssertSettingsAreEuqal(TfsSettings expectedTfsSettings, TfsSettings actualTfsSettings) { Assert.AreEqual(expectedTfsSettings.TfsServerConnectionString, actualTfsSettings.TfsServerConnectionString); Assert.AreEqual(expectedTfsSettings.TfsIgnore, actualTfsSettings.TfsIgnore); Assert.AreEqual(expectedTfsSettings.TfsNoLock, actualTfsSettings.TfsNoLock); Assert.AreEqual(expectedTfsSettings.ExclusiveCheckoutFileTypes, actualTfsSettings.ExclusiveCheckoutFileTypes); Assert.AreEqual(expectedTfsSettings.IgnoreUsers, actualTfsSettings.IgnoreUsers); Assert.AreEqual(expectedTfsSettings.ShareBinaryFileCheckout, actualTfsSettings.ShareBinaryFileCheckout); Assert.AreEqual(expectedTfsSettings.LockLevels, actualTfsSettings.LockLevels); Assert.AreEqual(expectedTfsSettings.AllowSavingLockedExclusiveFiles, actualTfsSettings.AllowSavingLockedExclusiveFiles); }
public void ProjectClearSettings() { TfsSettings expectedTfsSettings = TfsSettingsTests.ExpectedTfsSettings(true); TfsSettings.Load(@"TfsSettings\OverrideAllSettings.xml"); Assert.AreEqual(Path.GetFullPath(@"TfsSettings\OverrideAllSettings.xml"), TfsSettings.Default.LoadedSettingsPath); TfsSettings.Load(null); Assert.AreEqual(string.Empty, TfsSettings.Default.LoadedSettingsPath); TfsSettingsTests.AssertSettingsAreEuqal(expectedTfsSettings, TfsSettings.Default); }
protected string GetSetting(TfsSettings setting) => _settingValues[setting.ToString()];
public WorkItemConnector(TfsSettings tfsSettings, IHttpApiClient HttpApiClient) : base(tfsSettings, HttpApiClient) { }
public ChangesetsConnector(TfsSettings tfsSettings, IHttpApiClient httpApiClient) : base(tfsSettings, httpApiClient) { }
public PatchDocumentBuilder(ITfsSettingsProvider tfsSettingsProvider) { _tfsSettings = tfsSettingsProvider.ProvideTfsSettings(); _patchDocuments = new List <PatchDocument>(); }
public VersionControlConnector(TfsSettings tfsSettings, IHttpApiClient httpApiClient) : base(tfsSettings, httpApiClient) { }
public BaseConnector(TfsSettings TfsSettings, IHttpApiClient httpApiClient) { tfsSettings = TfsSettings; _httpApiClient = httpApiClient; }