Exemple #1
0
        public void AddNamedAndUnnamed()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(string.Empty, GetManager());
            dictionary.Add(GetManager());

            Assert.AreEqual(2, dictionary.Count);
        }
Exemple #2
0
        public void ThrowDriverAlreadyExist()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(GetManager());
            dictionary.Add(GetManager());

            Assert.Fail("Previous line should have failed the test.");
        }
Exemple #3
0
        public void ClearRemovesAll()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(GetManager());
            dictionary.Add(string.Empty, GetManager());
            dictionary.Clear();

            Assert.AreEqual(0, dictionary.Count);
        }
Exemple #4
0
        public void RemoveByName()
        {
            IManagerStore dictionary    = GetManagerStore();
            DriverManager managerToKeep = GetManager();

            dictionary.Add(managerToKeep);
            dictionary.Add(string.Empty, GetManager());
            dictionary.Remove(string.Empty);

            Assert.AreEqual(((WebServiceDriverManager)managerToKeep).Get(), dictionary.GetDriver <EventFiringWebServiceDriver, WebServiceDriverManager>());
        }
Exemple #5
0
        public void RemoveByType()
        {
            IManagerStore managerStore  = GetManagerStore();
            DriverManager managerToKeep = GetManager();

            managerStore.Add(GetManager());
            managerStore.Add(string.Empty, managerToKeep);
            managerStore.Remove <WebServiceDriverManager>();

            Assert.AreEqual(managerToKeep, managerStore.GetManager(string.Empty));
        }
Exemple #6
0
        public void ManagersMap()
        {
            IManagerStore managerStore   = GetManagerStore();
            DriverManager managerToKeep  = GetManager();
            DriverManager managerToKeep2 = GetManager();

            managerStore.Add(managerToKeep);
            managerStore.Add(string.Empty, managerToKeep2);

            Assert.AreEqual(((WebServiceDriverManager)managerToKeep).Get(), managerStore.GetDriver <EventFiringWebServiceDriver, WebServiceDriverManager>());
            Assert.AreEqual(managerToKeep2, managerStore.GetManager(string.Empty));
        }
Exemple #7
0
        public void AddIncrementCount()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(GetManager());

            Assert.AreEqual(1, dictionary.Count);
        }
Exemple #8
0
        public void AddManagerByType()
        {
            IManagerStore managerStore = GetManagerStore();

            managerStore.Add(GetManager());

            Assert.IsTrue(managerStore.Contains <WebServiceDriverManager>());
        }
Exemple #9
0
        public void CanOverrideExisting()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(GetManager());
            dictionary.AddOrOverride(GetManager());

            Assert.AreEqual(1, dictionary.Count);
        }