public void TestEmptyCtr() { Verb obj = new Verb(); Assert.IsInstanceOf<Verb>(obj); Assert.IsNull(obj.id); Assert.IsNull(obj.display); StringAssert.AreEqualIgnoringCase("{}", obj.ToJSON()); }
public void TestStringOfJSONCtr() { String id = "http://adlnet.gov/expapi/verbs/experienced"; String json = "{\"id\":\"" + id + "\"}"; StringOfJSON strOfJson = new StringOfJSON(json); Verb obj = new Verb(strOfJson); Assert.IsInstanceOf<Verb>(obj); Assert.That(obj.ToJSON(), Is.EqualTo(json)); }
public void TestJObjectCtr() { String id = "http://adlnet.gov/expapi/verbs/experienced"; JObject cfg = new JObject(); cfg.Add("id", id); Verb obj = new Verb(cfg); Assert.IsInstanceOf<Verb>(obj); Assert.That(obj.ToJSON(), Is.EqualTo("{\"id\":\"" + id + "\"}")); }