public void Next() { Mock<IRandomExtensions> randMock = new Mock<IRandomExtensions>(); var target = new RandomByteDataSource(randMock.Object); target.Next(null); randMock.Verify(a => a.GetByte(System.Byte.MinValue, System.Byte.MaxValue), @" The GetByte method on the IRandomExtensions object was not called. "); }