Ejemplo n.º 1
0
        public void GetConstructedUri_NoParameters_MatchesExpected()
        {
            var query = new ListGameVariants();

            var uri = query.GetConstructedUri();

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

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants", uri);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public void GetConstructedUri_OrderByDescending_MatchesExpected()
        {
            var query = new ListGameVariants()
                        .OrderByDescending();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?order=desc", uri);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        public void GetConstructedUri_OrderByAscending_MatchesExpected()
        {
            var query = new ListGameVariants()
                .OrderByAscending();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"ugc/h5/players/{null}/gamevariants?order=asc", uri);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        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);
        }