public void CompactLine_WithNullLine_ShouldThrowAnException() { //Arrange var positionHelper = new PositionHelper(); const string TestPosition = null; //Act positionHelper.CompactLine(TestPosition); //Assert is implicit }
public void CompactLine_WithInvalidCharacter_ShouldThrowAnException() { //Arrange var positionHelper = new PositionHelper(); const string TestPosition = @"yyyyyyyyybbbbbbbbbrrrrrrrrrgggggggggooooooooohhhhhhhhha"; //Act positionHelper.CompactLine(TestPosition); //Assert is implicit }
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); }
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); }
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); }
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); }
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); }
private static void AssertPositionsAreEqual(string expected, string actual) { var positionHelper = new PositionHelper(); Assert.AreEqual(positionHelper.NormalizeExternalFormat(expected), positionHelper.NormalizeExternalFormat(actual)); }