Example #1
0
        private IMonkey Setup(Func <Test, IEnumerable <Url> > funcLevel1, Func <Test, IEnumerable <Url> > funcLevel2 = null)
        {
            CacheMonkey monkey = new CacheMonkey();

            monkey.Name   = "CacheMonkey";
            monkey.APIUrl = this.APIUrl;
            monkey.WebUrl = this.WebUrl;
            monkey.AddTest(new Test()
            {
                Name          = "Now playing",
                Url           = new Url(this.APIUrl, "api/movies?type=current"),
                Validate      = Test.DefaultValidate(null),
                ScratchLevel1 = funcLevel1,
                ScratchLevel2 = funcLevel2,
            });
            monkey.AddTest(new Test()
            {
                Name          = "Upcoming",
                Url           = new Url(this.APIUrl, "api/movies?type=upcoming"),
                Validate      = Test.DefaultValidate(null),
                ScratchLevel1 = funcLevel1,
                ScratchLevel2 = funcLevel2,
            });
            return(monkey);
        }
Example #2
0
 private void InitiateCacheMonkey(Test test, IEnumerable<Url> urls)
 {
     CacheMonkey monkey = new CacheMonkey();
     monkey.Name = "CacheMonkey for " + test.Name;
     monkey.APIUrl = this.APIUrl;
     monkey.WebUrl = this.WebUrl;
     monkey.AddTests(
         urls.Select(url =>
         {
             return new Test()
             {
                 Name = test.Name + " - " + url.Part,
                 Url = url,
                 Validate = null, //test.Validate,
                 ScratchLevel1 = test.ScratchLevel2,
                 ScratchLevel2 = null,
             };
         }));
     monkey.Jump();
 }
Example #3
0
        private void InitiateCacheMonkey(Test test, IEnumerable <Url> urls)
        {
            CacheMonkey monkey = new CacheMonkey();

            monkey.Name   = "CacheMonkey for " + test.Name;
            monkey.APIUrl = this.APIUrl;
            monkey.WebUrl = this.WebUrl;
            monkey.AddTests(
                urls.Select(url =>
            {
                return(new Test()
                {
                    Name = test.Name + " - " + url.Part,
                    Url = url,
                    Validate = null,     //test.Validate,
                    ScratchLevel1 = test.ScratchLevel2,
                    ScratchLevel2 = null,
                });
            }));
            monkey.Jump();
        }
Example #4
0
 private IMonkey Setup(Func<Test, IEnumerable<Url>> funcLevel1, Func<Test, IEnumerable<Url>> funcLevel2 = null)
 {
     CacheMonkey monkey = new CacheMonkey();
     monkey.Name = "CacheMonkey";
     monkey.APIUrl = this.APIUrl;
     monkey.WebUrl = this.WebUrl;
     monkey.AddTest(new Test()
     {
         Name = "Now playing",
         Url = new Url(this.APIUrl, "api/movies?type=current"),
         Validate = Test.DefaultValidate(null),
         ScratchLevel1 = funcLevel1,
         ScratchLevel2 = funcLevel2,
     });
     monkey.AddTest(new Test()
     {
         Name = "Upcoming",
         Url = new Url(this.APIUrl, "api/movies?type=upcoming"),
         Validate = Test.DefaultValidate(null),
         ScratchLevel1 = funcLevel1,
         ScratchLevel2 = funcLevel2,
     });
     return monkey;
 }