public void GetConstructedUri_NoParameters_MatchesExpected()
        {
            var query = new GetImpulses();

            var uri = query.GetConstructedUri();

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

            var uri = query.GetConstructedUri();

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

            var uri = query.GetConstructedUri();

            Assert.AreEqual(BaseUri, uri);
        }
        public async Task GetImpulses_DoesNotThrow()
        {
            var query = new GetImpulses()
                .SkipCache();

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

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

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

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

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

            SerializationUtility <List <Impulse> > .AssertRoundTripSerializationIsPossible(result);
        }
        public async Task Query_DoesNotThrow()
        {
            var query = new GetImpulses()
                .SkipCache();

            var result = await _mockSession.Query(query);

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

            var result = await _mockSession.Query(query);

            Assert.IsInstanceOf(typeof(List <Impulse>), result);
            Assert.AreEqual(_impulses, result);
        }
        public async Task GetImpulses_IsSerializable()
        {
            var query = new GetImpulses()
                .SkipCache();

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

            var serializationUtility = new SerializationUtility<List<Impulse>>();
            serializationUtility.AssertRoundTripSerializationIsPossible(result);
        }
        public async Task GetImpulses_SchemaIsValid()
        {
            var impulsesSchema = JSchema.Parse(File.ReadAllText(Config.ImpulseJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.ImpulseJsonSchemaPath))
            });

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

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

            SchemaUtility.AssertSchemaIsValid(impulsesSchema, jArray);
        }
Exemple #11
0
        public async Task GetImpulses_SchemaIsValid()
        {
            var impulsesSchema = JSchema.Parse(File.ReadAllText(Halo5Config.ImpulseJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri  = new Uri(Path.GetFullPath(Halo5Config.ImpulseJsonSchemaPath))
            });

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

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

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

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

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

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

            SchemaUtility.AssertSchemaIsValid(schema, jContainer);
        }
        public async Task GetImpulses_ModelMatchesSchema()
        {
            var schema = JSchema.Parse(File.ReadAllText(Config.ImpulseJsonSchemaPath), new JSchemaReaderSettings
            {
                Resolver = new JSchemaUrlResolver(),
                BaseUri = new Uri(Path.GetFullPath(Config.ImpulseJsonSchemaPath))
            });

            var query = new GetImpulses()
                .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 GetImpulses();

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