public async Task GetCompetitiveSkillRankDesignations_DoesNotThrow()
        {
            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations()
                        .SkipCache();

            var result = await Global.Session.Query(query);

            Assert.IsInstanceOf(typeof(PagedResponse <ContentItemTypeA <Model.HaloWars2.Metadata.CompetitiveSkillRankDesignation.View> >), result);
        }
        public async Task GetConstructedUri_InvalidSkip(int skip)
        {
            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations()
                        .Skip(skip);

            await Global.Session.Query(query);

            Assert.Fail("An exception should have been thrown");
        }
        public async Task GetCompetitiveSkillRankDesignations_IsSerializable()
        {
            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations()
                        .SkipCache();

            var result = await Global.Session.Query(query);

            SerializationUtility <PagedResponse <ContentItemTypeA <Model.HaloWars2.Metadata.CompetitiveSkillRankDesignation.View> > > .AssertRoundTripSerializationIsPossible(result);
        }
        public void Uri_MatchesExpected(int skip)
        {
            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations();

            Assert.AreEqual("https://www.haloapi.com/metadata/hw2/csr-designations", query.Uri);

            query.Skip(skip);

            Assert.AreEqual($"https://www.haloapi.com/metadata/hw2/csr-designations?startAt={skip}", query.Uri);
        }
        public async Task GetCompetitiveSkillRankDesignations_SchemaIsValid()
        {
            var jSchema = JSchema.Parse(File.ReadAllText(Schema), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Schema))
            });

            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations()
                        .SkipCache();

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

            SchemaUtility.AssertSchemaIsValid(jSchema, jArray);
        }
        public async Task GetCompetitiveSkillRankDesignations_ModelMatchesSchema()
        {
            var schema = JSchema.Parse(File.ReadAllText(Schema), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Schema))
            });

            var query = new HaloSharp.Query.HaloWars2.Metadata.GetCompetitiveSkillRankDesignations()
                        .SkipCache();

            var result = await Global.Session.Query(query);

            var json       = JsonConvert.SerializeObject(result);
            var jContainer = JsonConvert.DeserializeObject <JObject>(json);

            SchemaUtility.AssertSchemaIsValid(schema, jContainer);
        }