Пример #1
0
 public void CompactLine_WithNullLine_ShouldThrowAnException()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = null;
     //Act
     positionHelper.CompactLine(TestPosition);
     //Assert is implicit
 }
Пример #2
0
 public void CompactLine_WithInvalidCharacter_ShouldThrowAnException()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @"yyyyyyyyybbbbbbbbbrrrrrrrrrgggggggggooooooooohhhhhhhhha";
     //Act
     positionHelper.CompactLine(TestPosition);
     //Assert is implicit
 }
Пример #3
0
 public void CompactLine_WithAUpperCaseLineShouldWork_ShouldThrowAnException()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @"YYYYYYYYYBBBBBBBBBRRRRRRRRRGGGGGGGGGOOOOOOOOOHHHHHHHHH";
     const string Expected = @"yyyyyyyyybbbbbbbbbrrrrrrrrrgggggggggooooooooohhhhhhhhh";
     //Act
     string actual = positionHelper.CompactLine(TestPosition);
     //Assert
     Assert.AreEqual(Expected, actual);
 }
Пример #4
0
 public void NormalizeExternalFormat_WithCorrectLayout_ShouldWork()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @"
     yyy
     yyy
     yyy
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     hhh
     hhh
     hhh
     ";
     const string Expected = @"
     yyy
     yyy
     yyy
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     hhh
     hhh
     hhh
     ";
     //Act
     string actual = positionHelper.NormalizeExternalFormat(TestPosition);
     //Assert
     Assert.AreEqual(Expected, actual);
 }
Пример #5
0
 public void ConvertLineToExternalFormat_WithTheMostCompactLayout_ShouldWork()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @"yyyyyyyyybbbbbbbbbrrrrrrrrrgggggggggooooooooohhhhhhhhh";
     const string Expected = @"
     yyy
     yyy
     yyy
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     hhh
     hhh
     hhh
     ";
     //Act
     string actual = positionHelper.ConvertLineToExternalFormat(TestPosition);
     //Assert
     Assert.AreEqual(Expected, actual);
 }
Пример #6
0
 public void ConvertLineToExternalFormat_WithAWideUpperCaseLayout_ShouldWork()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @" YYYYYYYYY BBBBBBBBB RRRRRRRRR GGGGGGGGG OOOOOOOOO HHHHHHHHH ";
     const string Expected = @"
     yyy
     yyy
     yyy
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     hhh
     hhh
     hhh
     ";
     //Act
     string actual = positionHelper.ConvertLineToExternalFormat(TestPosition);
     //Assert
     Assert.AreEqual(Expected, actual);
 }
Пример #7
0
 public void ConvertExernalFormatToLine_WithNormalizedLayout_ShouldWork()
 {
     //Arrange
     var positionHelper = new PositionHelper();
     const string TestPosition = @"
     yyy
     yyy
     yyy
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     bbb rrr ggg ooo
     hhh
     hhh
     hhh
     ";
     const string Expected = @"yyyyyyyyybbbbbbbbbrrrrrrrrrgggggggggooooooooohhhhhhhhh";
     //Act
     string actual = positionHelper.ConvertExernalFormatToLine(TestPosition);
     //Assert
     Assert.AreEqual(Expected, actual);
 }
Пример #8
0
 private static void AssertPositionsAreEqual(string expected, string actual)
 {
     var positionHelper = new PositionHelper();
     Assert.AreEqual(positionHelper.NormalizeExternalFormat(expected), positionHelper.NormalizeExternalFormat(actual));
 }