public void PackParse_WithMissingValue_ThrowsError(string name, string img) { (Pack actual, string json) = JsonHelper.GeneratePack(name, img); Assert.Throws <JsonReaderException>(() => { JObject jobj = JObject.Parse(json); Pack pack = JsonUserInput.ReadPackJson(jobj.CreateReader()); }); }
public void PackParse_Success() { (Pack actual, string json) = JsonHelper.GeneratePack("testpack", "testimg"); JObject jobj = JObject.Parse(json); Pack pack = JsonUserInput.ReadPackJson(jobj.CreateReader()); Assert.That( pack.Name == "testpack" && pack.ImagePath == "testimg", json ); }