コード例 #1
0
        public void TestNotSupported()
        {
            SincroRequiresNew ob  = new SincroRequiresNew();
            SynchRes          res = ob.CheckContextTransition(typeof(SincroNotSupported));

            Assert.IsTrue(res == SynchRes.NoSync, "Synchronizaton context not expected 1");

            SincroNotSupported ob2 = new SincroNotSupported();

            res = ob2.CheckContext(Thread.CurrentContext);
            Assert.IsTrue(res == SynchRes.NoSync, "Synchronizaton context not expected 2");
        }
コード例 #2
0
        public void TestRequiresNew()
        {
            SincroRequiresNew ob  = new SincroRequiresNew();
            SynchRes          res = ob.CheckContextTransition(typeof(SincroRequiresNew));

            Assert.IsTrue(res == SynchRes.NewSync, "New synchronizaton context expected");

            SincroRequiresNew ob2 = new SincroRequiresNew();

            res = ob2.CheckContext(Thread.CurrentContext);
            Assert.IsTrue(res == SynchRes.NewSync, "Synchronizaton context not expected");
        }