コード例 #1
0
ファイル: Test_5_8.cs プロジェクト: jkrez/Interview
 public void Question_5_8_InvalidCases()
 {
     TestHelpers.AssertExceptionThrown(() => Question_5_8.DrawScreen(null, 8, 1, 2, 3), typeof(ArgumentNullException));
     TestHelpers.AssertExceptionThrown(() => Question_5_8.DrawScreen(new byte[100], 1, 1, 2, 3), typeof(ArgumentOutOfRangeException));
     TestHelpers.AssertExceptionThrown(() => Question_5_8.DrawScreen(new byte[100], 8, -1, 2, 3), typeof(ArgumentOutOfRangeException));
     TestHelpers.AssertExceptionThrown(() => Question_5_8.DrawScreen(new byte[100], 8, 1000, 2, 3), typeof(ArgumentOutOfRangeException));
 }
コード例 #2
0
ファイル: Test_5_8.cs プロジェクト: jkrez/Interview
 private void Validate(byte[] expected, int width, int x1, int x2, int y)
 {
     byte[] screen = new byte[expected.Length];
     Question_5_8.DrawScreen(screen, width, x1, x2, y);
     CollectionAssert.AreEqual(expected, screen);
 }