public void MenuUtility_ToJson_1() { MenuFile menu = new MenuFile(); string actual = menu.ToJson(); Assert.AreEqual("[]", actual); }
public void MenuUtility_ToJson_2() { MenuFile menu = _GetMenu(); string actual = menu.ToJson(); Assert.AreEqual("[{\"code\":\"a\",\"comment\":\"Comment for a\"},{\"code\":\"b\",\"comment\":\"Comment for b\"},{\"code\":\"c\",\"comment\":\"Comment for c\"}]", actual); }
public void MenuFile_ToJson_1() { MenuFile menu = _GetMenu(); string actual = menu.ToJson() .Replace("\r", "").Replace("\n", "") .Replace("\"", "'"); string expected = "[{'code':'a','comment':'Comment for a'},{'code':'b','comment':'Comment for b'},{'code':'c','comment':'Comment for c'}]"; Assert.AreEqual(expected, actual); }