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

            var uri = query.GetConstructedUri();

            Assert.AreEqual(BaseUri, uri);
        }
Beispiel #2
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMedals();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("metadata/h5/metadata/medals", uri);
        }
Beispiel #3
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMedals();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("metadata/h5/metadata/medals", uri);
        }
        public async Task GetMedals()
        {
            var query = new GetMedals()
                .SkipCache();

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

            Assert.IsInstanceOf(typeof (List<Medal>), result);
        }
Beispiel #5
0
        public async Task GetMedals_DoesNotThrow()
        {
            var query = new GetMedals()
                        .SkipCache();

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

            Assert.IsInstanceOf(typeof(List <Medal>), result);
        }
Beispiel #6
0
        public async Task GetMedals_IsSerializable()
        {
            var query = new GetMedals()
                        .SkipCache();

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

            SerializationUtility <List <Medal> > .AssertRoundTripSerializationIsPossible(result);
        }
        public async Task GetMedals_IsSerializable()
        {
            var query = new GetMedals()
                .SkipCache();

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

            var serializationUtility = new SerializationUtility<List<Medal>>();
            serializationUtility.AssertRoundTripSerializationIsPossible(result);
        }
Beispiel #8
0
        public async Task Query_DoesNotThrow()
        {
            var query = new GetMedals()
                .SkipCache();

            var result = await _mockSession.Query(query);

            Assert.IsInstanceOf(typeof(List<Medal>), result);
            Assert.AreEqual(_medals, result);
        }
Beispiel #9
0
        public async Task Query_DoesNotThrow()
        {
            var query = new GetMedals()
                        .SkipCache();

            var result = await _mockSession.Query(query);

            Assert.IsInstanceOf(typeof(List <Medal>), result);
            Assert.AreEqual(_medals, result);
        }
Beispiel #10
0
        public async Task GetMedals_SchemaIsValid()
        {
            var medalsSchema = JSchema.Parse(File.ReadAllText(Config.MedalJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.MedalJsonSchemaPath))
            });

            var query = new GetMedals()
               .SkipCache();

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

            SchemaUtility.AssertSchemaIsValid(medalsSchema, jArray);
        }
Beispiel #11
0
        public async Task GetMedals_SchemaIsValid()
        {
            var medalsSchema = JSchema.Parse(File.ReadAllText(Halo5Config.MedalJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Halo5Config.MedalJsonSchemaPath))
            });

            var query = new GetMedals()
                        .SkipCache();

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

            SchemaUtility.AssertSchemaIsValid(medalsSchema, jArray);
        }
Beispiel #12
0
        public async Task GetMedals_ModelMatchesSchema()
        {
            var schema = JSchema.Parse(File.ReadAllText(Halo5Config.MedalJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Halo5Config.MedalJsonSchemaPath))
            });

            var query = new GetMedals()
                        .SkipCache();

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

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

            SchemaUtility.AssertSchemaIsValid(schema, jContainer);
        }
Beispiel #13
0
        public async Task GetMedals_ModelMatchesSchema()
        {
            var schema = JSchema.Parse(File.ReadAllText(Config.MedalJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.MedalJsonSchemaPath))
            });

            var query = new GetMedals()
                .SkipCache();

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

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

            SchemaUtility.AssertSchemaIsValid(schema, jContainer);
        }
Beispiel #14
0
        public void Uri_MatchesExpected()
        {
            var query = new GetMedals();

            Assert.AreEqual("https://www.haloapi.com/metadata/h5/metadata/medals", query.Uri);
        }