public void GetConstructedUri_NoParamaters_MatchesExpected() { var query = new GetMedals(); var uri = query.GetConstructedUri(); Assert.AreEqual(BaseUri, uri); }
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); }
public async Task GetMedals_DoesNotThrow() { var query = new GetMedals() .SkipCache(); var result = await Global.Session.Query(query); Assert.IsInstanceOf(typeof(List <Medal>), result); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public void Uri_MatchesExpected() { var query = new GetMedals(); Assert.AreEqual("https://www.haloapi.com/metadata/h5/metadata/medals", query.Uri); }