public void TextProvider_Boundary2() { var text = string.Empty; var textBuffer = new TextBufferMock(text, "text"); var textProvider = new TextProvider(textBuffer.CurrentSnapshot, 10); textProvider.CompareTo(text.Length, 4, "laZy", true).Should().BeFalse(); textProvider.CompareTo(0, 3, new string('c', 100), true).Should().BeFalse(); textProvider.CompareTo(0, 0, "", true).Should().BeTrue(); textProvider.CompareTo(0, 2, string.Empty, true).Should().BeFalse(); }
public void TextProvider_Boundary3() { var text = "ab"; var textBuffer = new TextBufferMock(text, "text"); var textProvider = new TextProvider(textBuffer.CurrentSnapshot, 10); textProvider.CompareTo(text.Length, 4, "fooo", true).Should().BeFalse(); textProvider.CompareTo(0, 3, new string('c', 100), true).Should().BeFalse(); textProvider.CompareTo(0, 1, "a", true).Should().BeTrue(); textProvider.CompareTo(0, 2, "ab", true).Should().BeTrue(); textProvider.CompareTo(0, 2, "abc", true).Should().BeFalse(); textProvider.CompareTo(1, 0, string.Empty, true).Should().BeTrue(); textProvider.CompareTo(2, 0, string.Empty, true).Should().BeTrue(); }
public void TextProvider_Boundary1() { var text = "Quick brown fox jumps over the lazy dog"; var textBuffer = new TextBufferMock(text, "text"); var textProvider = new TextProvider(textBuffer.CurrentSnapshot, 10); textProvider.CompareTo(text.Length, 4, "laZy", true).Should().BeFalse(); textProvider.CompareTo(text.Length - 1, 4, "laZy", true).Should().BeFalse(); textProvider.CompareTo(0, 3, new string('c', 100), true).Should().BeFalse(); textProvider.CompareTo(0, 0, "", true).Should().BeTrue(); textProvider.CompareTo(0, 2, string.Empty, true).Should().BeFalse(); textProvider.CompareTo(text.Length - 2, 3, "dog", true).Should().BeFalse(); }
public void TextProvider_CompareTo() { var text = "Quick brown fox jumps over the lazy dog"; var textBuffer = new TextBufferMock(text, "text"); var textProvider = new TextProvider(textBuffer.CurrentSnapshot, 10); textProvider.CompareTo(text.Length - 8, 4, "laZy", true).Should().BeTrue(); textProvider.CompareTo(text.Length - 8, 3, "laZy", true).Should().BeFalse(); textProvider.CompareTo(text.Length - 9, 4, "laZy", true).Should().BeFalse(); textProvider.CompareTo(text.Length - 3, 3, "dog", false).Should().BeTrue(); textProvider.CompareTo(text.Length - 3, 3, "dOg", false).Should().BeFalse(); textProvider.CompareTo(text.Length - 2, 3, "dog", true).Should().BeFalse(); }