static TestBase() { XElement element = XElement.Load(TestConfigurations.DefaultTestConfigFilePath); TestConfigurations configurations = TestConfigurations.ReadFromXml(element); TestBase.Initialize(configurations); }
static TestBase() { StorageFile xmlFile = Package.Current.InstalledLocation.GetFileAsync(TestConfigurations.DefaultTestConfigFilePath).AsTask().Result; XmlDocument xmlDoc = XmlDocument.LoadFromFileAsync(xmlFile).AsTask().Result; XDocument doc = XDocument.Parse(xmlDoc.GetXml()); TestConfigurations configurations = TestConfigurations.ReadFromXml(doc); TestBase.Initialize(configurations); }
/// <summary> /// Initialize unit tests with configuration /// </summary> static TestBase() { XElement element; using (var stream = new FileStream(TestConfigurations.DefaultTestConfigFilePath, FileMode.Open)) { element = XElement.Load(stream); } TestConfigurations configurations = TestConfigurations.ReadFromXml(element); TestBase.Initialize(configurations); }
static TestBase() { try { XElement element = XElement.Load(TestConfigurations.DefaultTestConfigFilePath); TestConfigurations configurations = TestConfigurations.ReadFromXml(element); TestBase.Initialize(configurations); } catch (System.IO.FileNotFoundException) { throw new System.IO.FileNotFoundException("To run tests you need to supply a TestConfigurations.xml file with credentials in the Test/Common folder. Use TestConfigurationsTemplate.xml as a template."); } }
static TestBase() { try { StorageFile xmlFile = Package.Current.InstalledLocation.GetFileAsync(TestConfigurations.DefaultTestConfigFilePath).AsTask().Result; XmlDocument xmlDoc = XmlDocument.LoadFromFileAsync(xmlFile).AsTask().Result; XDocument doc = XDocument.Parse(xmlDoc.GetXml()); TestConfigurations configurations = TestConfigurations.ReadFromXml(doc); TestBase.Initialize(configurations); } catch (System.IO.FileNotFoundException) { throw new System.IO.FileNotFoundException("To run tests you need to supply a TestConfigurations.xml file with credentials in the Test/Common folder. Use TestConfigurationsTemplate.xml as a template."); } }
static TestBase() { XElement element = XElement.Load(TestConfigurations.DefaultTestConfigFilePath); TestConfigurations = TestConfigurations.ReadFromXml(element); foreach (var tenant in TestConfigurations.TenantConfigurations) { if (tenant.TenantName == TestConfigurations.TargetTenantName) { TargetTenantConfig = tenant; break; } } StorageCredentials = new StorageCredentials(TargetTenantConfig.AccountName, TargetTenantConfig.AccountKey); CurrentTenantType = TargetTenantConfig.TenantType; }
static TestBase() { StorageFile xmlFile = Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(TestConfigurations.DefaultTestConfigFilePath).AsTask().Result; XmlDocument xmlDoc = XmlDocument.LoadFromFileAsync(xmlFile).AsTask().Result; XDocument doc = XDocument.Parse(xmlDoc.GetXml()); TestConfigurations = TestConfigurations.ReadFromXml(doc); foreach (TenantConfiguration tenant in TestConfigurations.TenantConfigurations) { if (tenant.TenantName == TestConfigurations.TargetTenantName) { TargetTenantConfig = tenant; break; } } StorageCredentials = new StorageCredentials(TestBase.TargetTenantConfig.AccountName, TestBase.TargetTenantConfig.AccountKey); CurrentTenantType = TargetTenantConfig.TenantType; }