public void NextBytes(int? bufferLength) { byte[] original = null; byte[] buffer = null; if (bufferLength.HasValue) { original = new byte[bufferLength.Value]; buffer = new byte[bufferLength.Value]; } var dataGenerator = new DataGenerator(10, 100); dataGenerator.NextBytes(buffer); if (original == null) { Assert.Fail("Original Is Null"); return; } int matches = 0; for (int i = 0; i < original.Length; i++) { if (original[i] == buffer[i]) { matches++; } } Assert.AreNotEqual(matches, original.Length, "{0} - {1}", matches, original.Length); }