Ejemplo n.º 1
0
        public void EnvironmentAgentRepository_Update()
        {
            var repo = new EnvironmentAgentRepository();

            var key = "D5";
            var environmentAgents = new List <EnvironmentAgent>
            {
                new EnvironmentAgent
                {
                    AgentCountryIsoCode = "FAK",
                    AgentCountry        = "FAKE COUNTRY",
                    AgentStateCode      = "FA",
                    AgentState          = "FAKE STATE",
                    AgentId             = "44440000",
                    AgentSequence       = "00",
                    AgentPassword       = "******",
                    Language            = "en",
                    SendCurrencies      = new List <string> {
                        "USD"
                    }
                }
            };

            repo.UpdateValue(key, environmentAgents);

            var containsKey = repo.ContainsKey(key);
            var value       = repo.GetValue <List <EnvironmentAgent> >(key);

            Assert.IsTrue(containsKey);
            Assert.AreEqual(1, value.Count);
            Assert.AreEqual("FAK", value.FirstOrDefault()?.AgentCountryIsoCode);
        }
Ejemplo n.º 2
0
        private List <EnvironmentAgent> GetAgentData()
        {
            var testSettings  = TestConfig.TestSettings;
            var acEnvironment = testSettings.AcEnvironment.ToString();
            var repo          = new EnvironmentAgentRepository();

            return(repo.ContainsKey(acEnvironment)
                ? repo.GetValue <List <EnvironmentAgent> >(acEnvironment)
                : new List <EnvironmentAgent>());
        }
Ejemplo n.º 3
0
        public void EnvironmentAgentRepository_RemoveValue()
        {
            var repo = new EnvironmentAgentRepository();

            var key = "D5";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }