Esempio n. 1
0
        public void GetConstructedUri_NoParameters_MatchesExpected()
        {
            var query = new GetMatches();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches{null}", uri);
        }
Esempio n. 2
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMatches();

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, null, null), uri);
        }
Esempio n. 3
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMatches();

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches{null}", uri);
        }
Esempio n. 4
0
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new GetMatches()
                .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{gamertag}/matches{null}", uri);
        }
Esempio n. 5
0
        public void GetConstructedUri_Skip_MatchesExpected(int skip)
        {
            var query = new GetMatches()
                        .Skip(skip);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?start={skip}", uri);
        }
Esempio n. 6
0
        public void GetConstructedUri_InGameMode_MatchesExpected(Enumeration.GameMode gameMode)
        {
            var query = new GetMatches()
                .InGameMode(gameMode);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?modes={gameMode}", uri);
        }
Esempio n. 7
0
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new GetMatches()
                        .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{gamertag}/matches{null}", uri);
        }
Esempio n. 8
0
        public void GetConstructedUri_Take_MatchesExpected(int take)
        {
            var query = new GetMatches()
                        .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?count={take}", uri);
        }
Esempio n. 9
0
        public void GetConstructedUri_InGameModes_MatchesExpected(Enumeration.GameMode gameMode1, Enumeration.GameMode gameMode2)
        {
            var query = new GetMatches()
                .InGameModes(new List<Enumeration.GameMode> {gameMode1, gameMode2});

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?modes={gameMode1},{gameMode2}", uri);
        }
Esempio n. 10
0
        public void GetConstructedUri_Skip_MatchesExpected(int skip)
        {
            var query = new GetMatches()
                .Skip(skip);

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, null, $"?start={skip}"), uri);
        }
Esempio n. 11
0
        public void GetConstructedUri_InGameModes_MatchesExpected(Enumeration.GameMode gameMode1, Enumeration.GameMode gameMode2)
        {
            var query = new GetMatches()
                .InGameModes(new List<Enumeration.GameMode> {gameMode1, gameMode2});

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, null, $"?modes={gameMode1},{gameMode2}"), uri);
        }
Esempio n. 12
0
        public void GetConstructedUri_InGameMode_MatchesExpected(Enumeration.GameMode gameMode)
        {
            var query = new GetMatches()
                .InGameMode(gameMode);

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, null, $"?modes={gameMode}" ), uri);
        }
Esempio n. 13
0
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new GetMatches()
                .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, gamertag, null), uri);
        }
Esempio n. 14
0
        public void GetConstructedUri_InGameMode_MatchesExpected(Enumeration.GameMode gameMode)
        {
            var query = new GetMatches()
                        .InGameMode(gameMode);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?modes={gameMode}", uri);
        }
Esempio n. 15
0
        public void GetConstructedUri_InGameModes_MatchesExpected(Enumeration.GameMode gameMode1, Enumeration.GameMode gameMode2)
        {
            var query = new GetMatches()
                        .InGameModes(new List <Enumeration.GameMode> {
                gameMode1, gameMode2
            });

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?modes={gameMode1},{gameMode2}", uri);
        }
Esempio n. 16
0
        public void GetConstructedUri_Complex_MatchesExpected(string gamertag, Enumeration.GameMode gameMode, int skip, int take)
        {
            var query = new GetMatches()
                        .ForPlayer(gamertag)
                        .InGameMode(gameMode)
                        .Skip(skip)
                        .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{gamertag}/matches?modes={gameMode}&start={skip}&count={take}", uri);
        }
Esempio n. 17
0
        public async Task GetMatches_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.MatchesJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Config.MatchesJsonSchemaPath))
            });

            var query = new GetMatches()
                        .ForPlayer(gamertag);

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

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }
Esempio n. 18
0
        public void GetConstructedUri_Skip_MatchesExpected(int skip)
        {
            var query = new GetMatches()
                .Skip(skip);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?start={skip}", uri);
        }
Esempio n. 19
0
        public void GetConstructedUri_Take_MatchesExpected(int take)
        {
            var query = new GetMatches()
                .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual(string.Format(BaseUri, null, $"?count={take}"), uri);
        }
Esempio n. 20
0
        public void GetConstructedUri_Take_MatchesExpected(int take)
        {
            var query = new GetMatches()
                .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{null}/matches?count={take}", uri);
        }
Esempio n. 21
0
        public void GetConstructedUri_Complex_MatchesExpected(string gamertag, Enumeration.GameMode gameMode, int skip, int take)
        {
            var query = new GetMatches()
                .ForPlayer(gamertag)
                .InGameMode(gameMode)
                .Skip(skip)
                .Take(take);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/players/{gamertag}/matches?modes={gameMode}&start={skip}&count={take}", uri);
        }
Esempio n. 22
0
        public async Task GetMatches_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.MatchesJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.MatchesJsonSchemaPath))
            });

            var query = new GetMatches()
                .ForPlayer(gamertag);

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

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }