public void IncompleteBracketedSectionReportsNoChildren() { // Arrange var original = new i18nBracketedSection() { Text = "[[[fox" }; int expected = 0; // Act int actual = original.ChildList.Count; // Assert Assert.AreEqual(expected, actual, @"NotFound BracketedSection is supposed to have no children, but it didn't."); }
public void BracketedSectionWithGrandchildrenOnlyReportsOneChild() { // Arrange var original = new i18nBracketedSection() { Text = "[[[quick [[[brown [[[fox]]]]]]]]]" }; int expected = 1; // Act int actual = original.ChildList.Count; // Assert Assert.AreEqual(expected, actual, @"BracketedSection is supposed to only count direct children, but it didn't."); }
public void BracketedSectionIncomplete() { // Arrange var original = new i18nBracketedSection() { Text = "[[[quick" }; string expected = "<incomplete>[[[quick"; // Act string actual = original.ToString(); // Assert Assert.AreEqual(expected, actual, false, @"BracketedSection is supposed to say when it can't find a set of brackets, but it didn't."); }
public void BracketedSectionToString() { // Arrange var original = new i18nBracketedSection() { Text = "[[[quick brown]]]" }; string expected = "[[[quick brown]]]"; // Act string actual = original.ToString(); // Assert Assert.AreEqual(expected, actual, false, @"BracketedSection is supposed to show it's contents when it has a match, but it didn't."); }
public void BracketedSectionNotFound() { // Arrange var original = new i18nBracketedSection() { Text = "" }; string expected = "<not found>"; // Act string actual = original.ToString(); // Assert Assert.AreEqual(expected, actual, false, @"BracketedSection is supposed to say when it can't find a set of brackets, but it didn't."); }