Ejemplo n.º 1
0
        public void AddNamedAndUnnamed()
        {
            IManagerStore dictionary = GetManagerStore();

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

            Assert.AreEqual(2, dictionary.Count);
        }
Ejemplo n.º 2
0
        public void ThrowDriverAlreadyExist()
        {
            IManagerStore dictionary = GetManagerStore();

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

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

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

            Assert.AreEqual(0, dictionary.Count);
        }
Ejemplo n.º 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>());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 7
0
        public void AddIncrementCount()
        {
            IManagerStore dictionary = GetManagerStore();

            dictionary.Add(GetManager());

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

            managerStore.Add(GetManager());

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

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

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