コード例 #1
0
 public static TestSettings Load()
 {
     TestSettings settings = new TestSettings();
     string settingsText = File.ReadAllText(@"../../TestSettings.txt");
     foreach(string settingString in settingsText.Split(new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries))
     {
         string[] settingsPart = settingString.Split(new string[]{"="}, StringSplitOptions.RemoveEmptyEntries);
         settings.settings.Add(settingsPart[0], settingsPart[1]);
     }
     return settings;
 }
コード例 #2
0
        public void InvokeCoreNodeTemplateWithTenantIdSucceeds()
        {
            //Test runs only if there is a file TestSettings.txt in the project folders containing the settings in the format
            //{key}={value}\n

            // Arrange
            TestSettings settings = TestSettings.Load();
            string       username = settings.GetValue("Username");
            string       password = settings.GetValue("Password");
            string       tenantId = settings.GetValue("TenantId");
            var          svc      = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = new System.Net.NetworkCredential(username, password);
            svc.TenantID    = tenantId;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult <Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }