Esempio n. 1
0
        public void XmlToCTableTest(string fname)
        {
            ConsoleAppBaseMocked mocked = new ConsoleAppBaseMocked("");

            string tmpPath  = Path.GetTempPath();
            string fullPath = Path.Combine(new string[] { tmpPath, fname });

            string xml = @"<?xml version='1.0' encoding='UTF-8'?>
<API>
    <OBJECT name='PARAM'>
        <FIELD name='FUNCTION_NAME'>mocked</FIELD>
    </OBJECT>
    <OBJECT name=''>
        <FIELD name='FIELD1'>mocked</FIELD>
    </OBJECT>
</API>";

            File.WriteAllText(fullPath, xml);

            mocked.AddArgument("infile", fname);
            mocked.AddArgument("basedir", tmpPath);
            mocked.DummyXmlToCTable();

            Assert.AreEqual(null, mocked.GetLogger(), "Returned context must be null!!!");
        }
Esempio n. 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!!!");
        }