-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTable.cs
40 lines (34 loc) · 1.11 KB
/
Table.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Xunit;
namespace Genometric.MSPC.CLI.Tests
{
public class Table
{
[Theory]
[InlineData("aaaaaa", 5)]
[InlineData("aaaaaa", 4)]
[InlineData("aaaaaa", 3)]
public void ColumnWidthLessThanContentLenght(string content, int length)
{
// Arrange
var table = new Logging.Table(new int[] { length });
// Act
var row = table.GetRow(columns: new string[] { content }).Replace('\t', ' ').Trim();
// Assert
Assert.Contains("...", row);
Assert.Equal(row.Length, length);
}
[Theory]
[InlineData("aaaaaa", 8)]
[InlineData("aaaaaa", 7)]
[InlineData("aaaaaa", 6)]
public void ShouldNotTruncateWhenEnoughSpaceAvailable(string content, int length)
{
// Arrange
var table = new Logging.Table(new int[] { length });
// Act
var row = table.GetRow(columns: new string[] { content }).Replace('\t', ' ').Trim();
// Assert
Assert.DoesNotContain("...", row);
}
}
}