-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSliceTest.cs
More file actions
20 lines (17 loc) · 806 Bytes
/
SliceTest.cs
File metadata and controls
20 lines (17 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using NUnit.Framework;
namespace DiffPlug.Selfie.Lib.Guts.Tests;
[TestFixture]
public class SliceTest {
[Test]
public void UnixLine() {
var singleLine = new Slice("A single line");
Assert.That(singleLine.UnixLine(1).ToString(), Is.EqualTo("A single line"));
var oneTwoThree = new Slice("\nI am the first\nI, the second\n\nFOURTH\n");
Assert.That(oneTwoThree.UnixLine(1).ToString(), Is.EqualTo(""));
Assert.That(oneTwoThree.UnixLine(2).ToString(), Is.EqualTo("I am the first"));
Assert.That(oneTwoThree.UnixLine(3).ToString(), Is.EqualTo("I, the second"));
Assert.That(oneTwoThree.UnixLine(4).ToString(), Is.EqualTo(""));
Assert.That(oneTwoThree.UnixLine(5).ToString(), Is.EqualTo("FOURTH"));
Assert.That(oneTwoThree.UnixLine(6).ToString(), Is.EqualTo(""));
}
}