Exemple #1
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMaps();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("metadata/h5/metadata/maps", uri);
        }
Exemple #2
0
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMaps();

            var uri = query.GetConstructedUri();

            Assert.AreEqual("metadata/h5/metadata/maps", uri);
        }
        public void GetConstructedUri_NoParamaters_MatchesExpected()
        {
            var query = new GetMaps();

            var uri = query.GetConstructedUri();

            Assert.AreEqual(BaseUri, uri);
        }
Exemple #4
0
        public async Task GetMaps_DoesNotThrow()
        {
            var query = new GetMaps()
                .SkipCache();

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

            Assert.IsInstanceOf(typeof(List<Map>), result);
        }
Exemple #5
0
        public async Task GetMaps_DoesNotThrow()
        {
            var query = new GetMaps()
                        .SkipCache();

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

            Assert.IsInstanceOf(typeof(List <Map>), result);
        }
Exemple #6
0
        public async Task GetMaps_IsSerializable()
        {
            var query = new GetMaps()
                        .SkipCache();

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

            SerializationUtility <List <Map> > .AssertRoundTripSerializationIsPossible(result);
        }
Exemple #7
0
        public async Task Query_DoesNotThrow()
        {
            var query = new GetMaps()
                .SkipCache();

            var result = await _mockSession.Query(query);

            Assert.IsInstanceOf(typeof(List<Map>), result);
            Assert.AreEqual(_maps, result);
        }
Exemple #8
0
        public async Task Query_DoesNotThrow()
        {
            var query = new GetMaps()
                        .SkipCache();

            var result = await _mockSession.Query(query);

            Assert.IsInstanceOf(typeof(List <Map>), result);
            Assert.AreEqual(_maps, result);
        }
        public async Task GetMaps_IsSerializable()
        {
            var query = new GetMaps()
                .SkipCache();

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

            var serializationUtility = new SerializationUtility<List<Map>>();
            serializationUtility.AssertRoundTripSerializationIsPossible(result);
        }
Exemple #10
0
        public async Task GetMaps_SchemaIsValid()
        {
            var mapsSchema = JSchema.Parse(File.ReadAllText(Config.MapJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.MapJsonSchemaPath))
            });

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

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

            SchemaUtility.AssertSchemaIsValid(mapsSchema, jArray);
        }
Exemple #11
0
        public async Task GetMaps_SchemaIsValid()
        {
            var mapsSchema = JSchema.Parse(File.ReadAllText(Config.MapJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Config.MapJsonSchemaPath))
            });

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

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

            SchemaUtility.AssertSchemaIsValid(mapsSchema, jArray);
        }
Exemple #12
0
        public async Task GetMaps_ModelMatchesSchema()
        {
            var schema = JSchema.Parse(File.ReadAllText(Config.MapJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Config.MapJsonSchemaPath))
            });

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

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

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

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

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

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

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

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

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