Exemplo n.º 1
0
        public void WhenTheResolveMethodIsCalledWithAnInterface_ThenTheCorrectRootObjectIsReturned()
        {
            // Act
            var rootObject = TabObject.Resolve <IA>();

            // Check
            Assert.AreEqual(typeof(A), rootObject.GetType());
            Assert.IsTrue(rootObject is IA);
        }
Exemplo n.º 2
0
        public void WhenAGenericInterfaceIsSearchedFor_ThenToCorrenspondingGenericImplementationIsResolved()
        {
            // Act
            var     rootObject = TabObject.Resolve <IA>();
            IG <IF> control    = rootObject.Find <IG <IF> >();
            IF      item       = control.Item;

            // Check
            Assert.AreEqual(typeof(G <IF>), control.GetType());
            Assert.AreEqual(typeof(F), control.Item.GetType());
        }
Exemplo n.º 3
0
 public void AbstractVdiTestWithImplicitNavigation()
 {
     try
     {
         vdi = TabObject.Resolve <IVdiTab>();
         vdi.Goto <IEvents>().SearchFor("praxis qualitätssicherung");
         DialogWait.For(() => vdi.On <IEvents>().EventList.Count(), c => c == 0, "0 seminars in list");
     }
     finally
     {
         vdi.Quit();
     }
 }
Exemplo n.º 4
0
        public void WhenMupltipleControlObjectInterfacesMatch_ThenTheClosestMatchIsReturned()
        {
            // Act
            var rootObject = TabObject.Resolve <IA>();

            var d = rootObject.Find <ID>(); // IE and IF also implement ID, yet we want to get "the closest" implementation, hence D
            var e = rootObject.Find <IE>();
            var f = rootObject.Find <IF>();

            // Check
            Assert.AreEqual(typeof(D), d.GetType());
            Assert.AreEqual(typeof(E), e.GetType());
            Assert.AreEqual(typeof(F), f.GetType());
        }
Exemplo n.º 5
0
        public void WhenTheOnMethodIsCalledWithInterfaces_ThenThesInterfacesAreResolveToToCorrectType()
        {
            // Act
            var rootObject = TabObject.Resolve <IA>();
            var ia         = rootObject.On <IA>();
            var ib         = ia.On <IB>();
            var ic         = ib.On <IC>();

            // Check
            Assert.IsTrue(ia is IA); // check IA from root
            Assert.AreEqual(typeof(A), ia.GetType());
            Assert.IsTrue(ib is IB); // check IB from IA
            Assert.AreEqual(typeof(B), ib.GetType());
            Assert.IsTrue(ic is IC); // check IC from IB
            Assert.AreEqual(typeof(C), ic.GetType());
        }