Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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);
 }