Ejemplo n.º 1
0
        public void Build_ShouldReturnFactoryFactory()
        {
            var ffb            = new FactoryFactoryBuilder();
            var factoryFactory = ffb.Build();

            Assert.IsNotNull(factoryFactory);
        }
Ejemplo n.º 2
0
        public TestConfiguration()
        {
            var keyPath             = Path.Combine("Secrets", "OrgPrivateKey.txt");
            var idPath              = Path.Combine("Secrets", "OrgId.txt");
            var appiumConfiguration = Path.Combine("Secrets", "AppiumConfig.txt");

            if (!File.Exists(keyPath) || !File.Exists(idPath))
            {
                throw new Exception($"Test configuration is invalid -- files with secrets should exist: {keyPath}, {idPath}");
            }

            var factoryFactoryBuilder = new FactoryFactoryBuilder();

            var apiUrlPath = Path.Combine("Secrets", "ApiUrl.txt");

            if (File.Exists(apiUrlPath))
            {
                var apiUrl = File.ReadAllText(apiUrlPath);
                factoryFactoryBuilder.SetApiBaseUrl(apiUrl);
            }

            var orgPrivateKey  = File.ReadAllText(keyPath);
            var orgId          = File.ReadAllText(idPath);
            var factoryFactory = factoryFactoryBuilder.Build();

            organizationFactory = factoryFactory.MakeOrganizationFactory(orgId, orgPrivateKey);

            if (File.Exists(appiumConfiguration))
            {
                appiumConfigs = JsonConvert.DeserializeObject <AppiumConfigs>(File.ReadAllText(appiumConfiguration));
            }
        }
Ejemplo n.º 3
0
        private static FactoryFactory MakeFactoryFactory(string apiURL)
        {
            var factoryFactoryBuilder = new FactoryFactoryBuilder();

            if (apiURL != null)
            {
                factoryFactoryBuilder.SetApiBaseUrl(apiURL).SetOffsetTtl(60);
            }
            var factory = factoryFactoryBuilder.Build();

            return(factory);
        }