Пример #1
0
        public void FindPathTest(string pPath, string pMethod, bool pResult)
        {
            Context.Params = new AppParams(new string[] { });
            Context.Log    = new ConsoleLogger();
            Context.Log.SetLogLevel("Info");

            APIRegistry registry = new APIRegistry();

            APIPath foundAPIPath = registry.FindPathProcessor(pPath, pMethod, out List <string> oArguments);

            Assert.That(oArguments.Count == 0, "FindPathProcessor found arguments should be zero");
            Assert.That((foundAPIPath != null) == pResult, "FindPathProcessor did/didn't find " + pPath);
        }
Пример #2
0
        public void PathWithArgTest(string pPath, string pMethod, string pResult)
        {
            Context.Params = new AppParams(new string[] { });
            Context.Log    = new ConsoleLogger();
            Context.Log.SetLogLevel("Info");

            APIRegistry registry = new APIRegistry();

            APIPath foundAPIPath = registry.FindPathProcessor(pPath, pMethod, out List <string> oArguments);

            Assert.That(foundAPIPath != null, "Didn't find path for " + pPath);
            Assert.That(oArguments.Count == 1, "FindPathProcessor did not find argument");
            Assert.That(oArguments[0] == pResult, "FindPathProcessor did not collect argument value");
        }