예제 #1
0
        public void GetKnownNoSqlContextWithAuthenTest(string provider)
        {
            ConsoleAppBaseMocked mocked = new ConsoleAppBaseMocked(provider);

            AddAuthenArguments(mocked);

            var ctx1 = mocked.GetNoSqlContextWithAuthen(provider);
            var ctx2 = mocked.GetNoSqlContext();

            Assert.AreNotEqual(null, ctx1, "Returned context must not be null!!!");
            Assert.AreEqual(null, ctx2, "Returned context must be null!!!");
        }
예제 #2
0
        public void SetterAndGetterTest(string provider)
        {
            ConsoleAppBaseMocked mocked = new ConsoleAppBaseMocked(provider);

            AddAuthenArguments(mocked);

            mocked.SetNoSqlContext(null);
            mocked.SetStorageContext(null);
            mocked.SetLogger(null);

            mocked.DumpParameter();
            var args = mocked.GetArguments();

            Assert.AreEqual(5, args.Count, "Argument count should match!!!");

            Assert.AreEqual(null, mocked.GetNoSqlContext(), "Returned context must be null!!!");
            Assert.AreEqual(null, mocked.GetStorageContext(), "Returned context must be null!!!");
            Assert.AreEqual(null, mocked.GetLogger(), "Returned context must be null!!!");
        }
예제 #3
0
        public void GetUnknownNoSqlContextWithAuthenTest(string provider)
        {
            ConsoleAppBaseMocked mocked = new ConsoleAppBaseMocked(provider);

            AddAuthenArguments(mocked);

            try
            {
                var ctx1 = mocked.GetNoSqlContextWithAuthen(provider);
                Assert.Fail("Exception should be thrown here!!!");
            }
            catch
            {
            }

            var ctx2 = mocked.GetNoSqlContext();
            var ctx3 = mocked.GetStorageContext();

            Assert.AreEqual(null, ctx2, "Returned context must be null!!!");
            Assert.AreEqual(null, ctx3, "Returned context must be null!!!");
        }