public void SetCurrentPublicKeyTtl_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var result = ffb.SetCurrentPublicKeyTtl(10); Assert.AreSame(ffb, result); }
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)); } }
public void SetApiIdentifier_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var result = ffb.SetApiIdentifier("test"); Assert.AreSame(ffb, result); }
public void AddOrgPrivateKey_ShouldAddKey() { var ffb = new FactoryFactoryBuilder(); var result = ffb.AddOrganizationPrivateKey(TestConsts.DefaultOrgId.ToString("D"), TestConsts.DefaultPrivateKey); Assert.AreSame(ffb, result); }
public void SetRequestExpireSeconds_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var result = ffb.SetRequestExpireSeconds(10); Assert.AreSame(ffb, result); }
public void Build_ShouldReturnFactoryFactory() { var ffb = new FactoryFactoryBuilder(); var factoryFactory = ffb.Build(); Assert.IsNotNull(factoryFactory); }
public void SetCrypto_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var crypto = new Mock <ICrypto>().Object; var result = ffb.SetCrypto(crypto); Assert.AreSame(ffb, result); }
public void SetCache_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var cache = new Mock <ICache>().Object; var result = ffb.SetCache(cache); Assert.AreSame(ffb, result); }
public void SetHttpClient_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); var http = new Mock <IHttpClient>().Object; var result = ffb.SetHttpClient(http); Assert.AreSame(ffb, result); }
public void SetCurrentPublicKeyTttl_ShouldReturnSelf() { var ffb = new FactoryFactoryBuilder(); #pragma warning disable CS0612 var result = ffb.SetCurrentPublicKeyTttl(10); #pragma warning restore Assert.AreSame(ffb, result); }
private static FactoryFactory MakeFactoryFactory(string apiURL) { var factoryFactoryBuilder = new FactoryFactoryBuilder(); if (apiURL != null) { factoryFactoryBuilder.SetApiBaseUrl(apiURL).SetOffsetTtl(60); } var factory = factoryFactoryBuilder.Build(); return(factory); }