public void GetConstructedUri_NoParameters_MatchesExpected()
        {
            var query = new ListGameVariants();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants", uri);
        }
        public void GetConstructedUri_NoParameters_MatchesExpected()
        {
            var query = new ListGameVariants();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants", uri);
        }
        public void GetConstructedUri_Skip_MatchesExpected(int skip)
        {
            var query = new ListGameVariants()
                        .Skip(skip);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?start={skip}", uri);
        }
        public void GetConstructedUri_OrderByDescending_MatchesExpected()
        {
            var query = new ListGameVariants()
                        .OrderByDescending();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?order=desc", uri);
        }
        public void GetConstructedUri_SortBy_MatchesExpected(Enumeration.UserGeneratedContentSort sort)
        {
            var query = new ListGameVariants()
                        .SortBy(sort);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?sort={sort}", uri);
        }
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new ListGameVariants()
                        .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{gamertag}/gamevariants", uri);
        }
        public void GetConstructedUri_Take_MatchesExpected(int take)
        {
            var query = new ListGameVariants()
                        .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?count={take}", uri);
        }
        public void GetConstructedUri_OrderByAscending_MatchesExpected()
        {
            var query = new ListGameVariants()
                .OrderByAscending();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?order=asc", uri);
        }
        public void GetConstructedUri_SortBy_MatchesExpected(Enumeration.UserGeneratedContentSort sort)
        {
            var query = new ListGameVariants()
                .SortBy(sort);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?sort={sort}", uri);
        }
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new ListGameVariants()
                .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{gamertag}/gamevariants", uri);
        }
        public void GetConstructedUri_Complex_MatchesExpected(string gamertag, Enumeration.UserGeneratedContentSort sort, int skip, int take)
        {
            var query = new ListGameVariants()
                        .ForPlayer(gamertag)
                        .SortBy(sort)
                        .OrderByAscending()
                        .Skip(skip)
                        .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{gamertag}/gamevariants?sort={sort}&order=asc&start={skip}&count={take}", uri);
        }
        public async Task ListGameVariants_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.UserGeneratedContentGameVariantsJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Config.UserGeneratedContentGameVariantsJsonSchemaPath))
            });

            var query = new ListGameVariants()
                        .ForPlayer(gamertag)
                        .SkipCache();

            var jArray = await Global.Session.Get <JObject>(query.GetConstructedUri());

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }
        public void GetConstructedUri_Skip_MatchesExpected(int skip)
        {
            var query = new ListGameVariants()
                .Skip(skip);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?start={skip}", uri);
        }
        public async Task ListGameVariants_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.UserGeneratedContentGameVariantsJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.UserGeneratedContentGameVariantsJsonSchemaPath))
            });

            var query = new ListGameVariants()
                .ForPlayer(gamertag)
                .SkipCache();

            var jArray = await Global.Session.Get<JObject>(query.GetConstructedUri());

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }
        public void GetConstructedUri_Complex_MatchesExpected(string gamertag, Enumeration.UserGeneratedContentSort sort, int skip, int take)
        {
            var query = new ListGameVariants()
                .ForPlayer(gamertag)
                .SortBy(sort)
                .OrderByAscending()
                .Skip(skip)
                .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{gamertag}/gamevariants?sort={sort}&order=asc&start={skip}&count={take}", uri);
        }
        public void GetConstructedUri_Take_MatchesExpected(int take)
        {
            var query = new ListGameVariants()
                .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?count={take}", uri);
        }