public void GenerateRandomValueTest(int min, int max, int actual, [Frozen] Mock <IRandomExecutor> executor, RandomService sut) { //arrange executor.Setup(service => service.Next(min - 500, max - 500)).Returns(actual); //act var expected = sut.GenerateRandomValue(min, max); //assert executor.Verify(service => service.Next(min - 500, max - 500), Times.AtLeastOnce); Assert.Equal(expected, actual); }