public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetCustomServiceRecord();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("stats/h5/servicerecords/custom", uri);
        }
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetCustomServiceRecord();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("stats/h5/servicerecords/custom", uri);
        }
        public void GetConstructedUri_ForPlayer_MatchesExpected(string gamertag)
        {
            var query = new GetCustomServiceRecord()
                        .ForPlayer(gamertag);

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/servicerecords/custom?players={gamertag}", uri);
        }
        public void GetConstructedUri_ForPlayers_MatchesExpected(string gamertag, string gamertag2)
        {
            var query = new GetCustomServiceRecord()
                .ForPlayers(new List<string> { gamertag, gamertag2 });

            var uri = query.GetConstructedUri();

            Assert.AreEqual($"stats/h5/servicerecords/custom?players={gamertag},{gamertag2}", uri);
        }
        public async Task GetCustomServiceRecord_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.CustomServiceRecordJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Config.CustomServiceRecordJsonSchemaPath))
            });

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

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

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }
        public async Task GetCustomServiceRecord_SchemaIsValid(string gamertag)
        {
            var weaponsSchema = JSchema.Parse(File.ReadAllText(Config.CustomServiceRecordJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.CustomServiceRecordJsonSchemaPath))
            });

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

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

            SchemaUtility.AssertSchemaIsValid(weaponsSchema, jArray);
        }