public void GetConstructedUri_NoParameters_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("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); }
public async Task GetImpulses_DoesNotThrow() { var query = new GetImpulses() .SkipCache(); var result = await Global.Session.Query(query); Assert.IsInstanceOf(typeof(List <Impulse>), result); }
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); }
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); }
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); }
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); }
public void Uri_MatchesExpected() { var query = new GetImpulses(); Assert.AreEqual("https://www.haloapi.com/metadata/h5/metadata/impulses", query.Uri); }