Exemplo n.º 1
0
		public void Should_parse_text_like_header_correctly()
		{
			diff = new FileUniDiff(diff5.ToStream());

			diff.RemovedLines.Count()
				.Should().Be(5);
		}
Exemplo n.º 2
0
		public void Should_parse_incomplete_lines_correctly()
		{
			diff = new FileUniDiff(diff4.ToStream());

			diff.AddedLines.Max()
				.Should().Be(16);
		}
Exemplo n.º 3
0
		public void Can_parse_incomplete_hunk_header()
		{
			diff = new FileUniDiff(diff4.ToStream());

			diff.AddedLines.Count()
				.Should().Be(16);
			diff.RemovedLines.Count()
				.Should().Be(1);
		}
Exemplo n.º 4
0
		public void Should_be_empty_for_empty_stream()
		{
			diff = new FileUniDiff("".ToStream());

			diff.AddedLines.Count()
				.Should().Be(0);
			diff.RemovedLines.Count()
				.Should().Be(0);
			diff.IsEmpty
				.Should().Be.True();
		}
Exemplo n.º 5
0
		public void Can_identify_removed_lines()
		{
			diff = new FileUniDiff(diff1.ToStream());

			diff.RemovedLines.ToArray()
				.Should().Have.SameSequenceAs(new int[] { 12, 13 });

			diff = new FileUniDiff(diff2.ToStream());

			diff.RemovedLines.ToArray()
				.Should().Have.SameSequenceAs(new int[] { 92, 176 });
		}
Exemplo n.º 6
0
		public void Can_identify_added_lines()
		{
			diff = new FileUniDiff(diff1.ToStream());

			diff.AddedLines.ToArray()
				.Should().Have.SameSequenceAs(new int[] { 12, 23, 24, 25, 26, 27 });

			diff = new FileUniDiff(diff2.ToStream());

			diff.AddedLines.ToArray()
				.Should().Have.SameSequenceAs(new int[] { 92, 176, 231 });
		}
Exemplo n.º 7
0
        public void Should_parse_text_like_header_correctly()
        {
            diff = new FileUniDiff(diff5.ToStream());

            diff.RemovedLines.Count()
                .Should().Be(5);
        }
Exemplo n.º 8
0
        public void Should_parse_incomplete_lines_correctly()
        {
            diff = new FileUniDiff(diff4.ToStream());

            diff.AddedLines.Max()
                .Should().Be(16);
        }
Exemplo n.º 9
0
        public void Should_be_empty_for_empty_stream()
        {
            diff = new FileUniDiff("".ToStream());

            diff.AddedLines.Count()
                .Should().Be(0);
            diff.RemovedLines.Count()
                .Should().Be(0);
            diff.IsEmpty
                .Should().Be.True();
        }
Exemplo n.º 10
0
        public void Can_parse_incomplete_hunk_header()
        {
            diff = new FileUniDiff(diff4.ToStream());

            diff.AddedLines.Count()
                .Should().Be(16);
            diff.RemovedLines.Count()
                .Should().Be(1);
        }
Exemplo n.º 11
0
        public void Can_identify_removed_lines()
        {
            diff = new FileUniDiff(diff1.ToStream());

            diff.RemovedLines.ToArray()
                .Should().Have.SameSequenceAs(new int[] { 12, 13 });

            diff = new FileUniDiff(diff2.ToStream());

            diff.RemovedLines.ToArray()
                .Should().Have.SameSequenceAs(new int[] { 92, 176 });
        }
Exemplo n.º 12
0
        public void Can_identify_added_lines()
        {
            diff = new FileUniDiff(diff1.ToStream());

            diff.AddedLines.ToArray()
                .Should().Have.SameSequenceAs(new int[] { 12, 23, 24, 25, 26, 27 });

            diff = new FileUniDiff(diff2.ToStream());

            diff.AddedLines.ToArray()
                .Should().Have.SameSequenceAs(new int[] { 92, 176, 231 });
        }