public void ToJson_CorrectString_StructREF() { //arrange var jsonStruct = new MixedJsonRefStruct(97, "Jack", null, true); //act var json = ToJson(ref jsonStruct); //assert Assert.That(json.ToString(), Is.EqualTo("{\"Age\":97,\"IsTrue\":true,\"Name\":\"Jack\",\"NullProperty\":null}")); }
protected override string ToJson(ref MixedJsonRefStruct jsonClass) { var jsonUtf8 = _convert.ToJsonUtf8(ref jsonClass); return(Encoding.UTF8.GetString(jsonUtf8)); }
protected override string ToJson(ref MixedJsonRefStruct jsonClass) { return(_convert.ToJson(ref jsonClass).ToString()); }
protected abstract string ToJson(ref MixedJsonRefStruct jsonClass);