You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is my UnitTest Code: using UnityEngine; using UnityEditor; using UnityEngine.TestTools; using NUnit.Framework; using System.Collections; using YamlDotNet.Serialization; using YamlDotNet.Samples.Helpers; using YamlDotNet.Serialization.NamingConventions; public class YamlZeroTest { [Test] public void YamlZeroTestSimplePasses() { Test test = new Test (); test.x = 0; test.y = 1; var serialize = new SerializerBuilder ().Build (); string s = serialize.Serialize (test); string expect = @" x: 0 y: 1 "; Assert.AreEqual(expect.Trim(),s); } } class Test { public int x{get;set;} public int y{get;set;} }
test can't pass.
I found that ,when x is 0, x dissappeared in the yaml string . Expected: "x: 0\ny: 1" But was: "y: 1\n"
I am not sure if this is a bug.
What can I do to show x in the yaml string?
The text was updated successfully, but these errors were encountered:
this is my UnitTest Code:
using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
using YamlDotNet.Serialization;
using YamlDotNet.Samples.Helpers;
using YamlDotNet.Serialization.NamingConventions;
public class YamlZeroTest {
[Test]
public void YamlZeroTestSimplePasses() {
Test test = new Test ();
test.x = 0;
test.y = 1;
var serialize = new SerializerBuilder ().Build ();
string s = serialize.Serialize (test);
string expect = @"
x: 0
y: 1
";
Assert.AreEqual(expect.Trim(),s);
}
}
class Test
{
public int x{get;set;}
public int y{get;set;}
}
test can't pass.
I found that ,when x is 0, x dissappeared in the yaml string .
Expected: "x: 0\ny: 1"
But was: "y: 1\n"
I am not sure if this is a bug.
What can I do to show x in the yaml string?
The text was updated successfully, but these errors were encountered: