コード例 #1
0
 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());
     });
 }
コード例 #2
0
        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
                );
        }