Beispiel #1
0
        public async Task ValidateAllJsonFilesTest()
        {
            // test all files
            using Config cfg = new Config
                  {
                      Server        = "http://localhost",
                      Timeout       = 30,
                      MaxConcurrent = 100
                  };

            cfg.Files.Add("msft.json");

            // load and validate all of our test files
            using var wv = new WebV(cfg);

            // file not found test
            Assert.Null(wv.ReadJson("test"));

            // test with null config
            Assert.NotEqual(0, await wv.RunOnce(null, new System.Threading.CancellationToken()).ConfigureAwait(false));
        }
Beispiel #2
0
        public async Task ValidateAllJsonFilesTest()
        {
            // test all files
            using Config cfg = new Config
                  {
                      Server  = "http://localhost",
                      Timeout = 30,
                      MaxConcurrentRequests = 100
                  };

            cfg.FileList.Add("actorById.json");
            cfg.FileList.Add("bad.json");
            cfg.FileList.Add("baseline.json");
            cfg.FileList.Add("benchmark.json");
            cfg.FileList.Add("dotnet.json");
            cfg.FileList.Add("featured.json");
            cfg.FileList.Add("foreach.json");
            cfg.FileList.Add("genres.json");
            cfg.FileList.Add("java.json");
            cfg.FileList.Add("movieById.json");
            cfg.FileList.Add("moviesByActorId.json");
            cfg.FileList.Add("msft.json");
            cfg.FileList.Add("node.json");
            cfg.FileList.Add("rating.json");
            cfg.FileList.Add("search.json");
            cfg.FileList.Add("year.json");

            // load and validate all of our test files
            using var wv = new WebV(cfg);

            // file not found test
            Assert.Null(wv.ReadJson("foo"));

            // test with null config
            Assert.NotEqual(0, await wv.RunOnce(null, new System.Threading.CancellationToken()).ConfigureAwait(false));

            cfg.Dispose();
        }