public void ToJson_ValidComplexObject_ReturnsJson() { var item = Helper.GetComplexFake(); string result = JSerializer.ToJson(item); Assert.IsTrue(result.Length > 0); }
public void FromJson_ValidComplexJson_ReturnsObject() { var item = Helper.GetComplexFake(); string json = JSerializer.ToJson(item); var fromJsonObj = JSerializer.FromJson <ComplexFake>(json); Assert.True(fromJsonObj != null); }
public void ToJson_InvalidObject_Throws() { SimpleFake fake = null; Assert.Throws <ArgumentException>(() => JSerializer.ToJson(fake)); }