Beispiel #1
0
        public static void InitHttpTest(this SimpleIoc simpleIoc)
        {
            var simpleConfigFile = SimpleConfigFactory.ResolveFile();
            var httpTestConfig   = AsyncHelper.RunSync(() => simpleConfigFile.ReadFile <HttpTestConfig>(null));

            if (httpTestConfig == null)
            {
                httpTestConfig = HttpTestConfig.Instance;
                simpleConfigFile.SaveFile(HttpTestConfig.Instance);
            }

            HttpTestConfig.Instance = httpTestConfig;

            simpleIoc.Register <ISimpleConfigFile>(() => simpleConfigFile);
            simpleIoc.Register <HttpTestConfig>(() => HttpTestConfig.Instance);

            simpleIoc.Register <IWebApiTester>(() => WebApiTester.Resolve());
            simpleIoc.Register <WebApiTester>(() => (WebApiTester)simpleIoc.Resolve <IWebApiTester>());

            simpleIoc.Register <TestClientSpanApiVo>(() => new TestClientSpanApiVo(simpleIoc.Resolve <ISimpleConfigFile>(), simpleIoc.Resolve <IWebApiTester>()));
            simpleIoc.Register <MainVo>(() => new MainVo(simpleIoc.Resolve <ISimpleConfigFile>(), simpleIoc.Resolve <IWebApiTester>()));

            var logFileEnabled = httpTestConfig.LogFileEnabled;

            SimpleLogFactory.Instance.LogFileEnabledFunc = (category) => logFileEnabled;
        }
Beispiel #2
0
        public void Test1()
        {
            var target = new WebApiTester();

            var inputFiles = new string[]
            {
                @"D:\tests\1_input.json",
                @"D:\tests\2.input.json",
                @"D:\tests\3-input.json"
            };
            var outputFiles = new string[]
            {
                @"D:\tests\1-output.json",
                @"D:\tests\2_output.json"
            };

            var result = target.MatchFiles(inputFiles, outputFiles);
        }