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)); }
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); }