public void FixJsonCommas_CloseBraceFollowedByCloseBraceWithNewLines_CommaRemoved() { var json = "{" + Environment.NewLine + " {" + Environment.NewLine + " \"foo\": \"bar\"" + Environment.NewLine + " }, " + Environment.NewLine + " {" + Environment.NewLine + " \"foo\": \"bar\"" + Environment.NewLine + " }, " + Environment.NewLine + "}"; var expected = "{" + Environment.NewLine + " {" + Environment.NewLine + " \"foo\": \"bar\"" + Environment.NewLine + " }, " + Environment.NewLine + " {" + Environment.NewLine + " \"foo\": \"bar\"" + Environment.NewLine + " } " + Environment.NewLine + "}"; var actual = new JsonFileFixerService().Fix(json); Assert.Equal(expected, actual); }
public void FixJsonCommas_DoubleQuoteFollowedByCloseBrace_CommaRemoved() { var json = "{" + " \"foo\": \"bar\"," + " \"foo\": \"bar\", " + "}"; var expected = "{" + " \"foo\": \"bar\"," + " \"foo\": \"bar\" " + "}"; var actual = new JsonFileFixerService().Fix(json); Assert.Equal(expected, actual); }