Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void NoProjectSettingsFile()
        {
            TfsSettings expectedTfsSettings = TfsSettingsTests.ExpectedTfsSettings(true);

            Assert.AreEqual(string.Empty, TfsSettings.Default.LoadedSettingsPath);
            TfsSettingsTests.AssertSettingsAreEuqal(expectedTfsSettings, TfsSettings.Default);
        }
Esempio n. 3
0
 protected TfsRestProxyBase(
     IRestProxy restProxy,
     ITfsSettingsProvider tfsSettingsProvider)
 {
     _restProxy   = restProxy;
     _tfsSettings = tfsSettingsProvider.ProvideTfsSettings();
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
 protected string GetSetting(TfsSettings setting) => _settingValues[setting.ToString()];
Esempio n. 9
0
 public WorkItemConnector(TfsSettings tfsSettings, IHttpApiClient HttpApiClient) : base(tfsSettings, HttpApiClient)
 {
 }
Esempio n. 10
0
 public ChangesetsConnector(TfsSettings tfsSettings, IHttpApiClient httpApiClient) : base(tfsSettings, httpApiClient)
 {
 }
Esempio n. 11
0
 public PatchDocumentBuilder(ITfsSettingsProvider tfsSettingsProvider)
 {
     _tfsSettings    = tfsSettingsProvider.ProvideTfsSettings();
     _patchDocuments = new List <PatchDocument>();
 }
Esempio n. 12
0
 public VersionControlConnector(TfsSettings tfsSettings, IHttpApiClient httpApiClient) : base(tfsSettings, httpApiClient)
 {
 }
Esempio n. 13
0
 public BaseConnector(TfsSettings TfsSettings, IHttpApiClient httpApiClient)
 {
     tfsSettings    = TfsSettings;
     _httpApiClient = httpApiClient;
 }