public static void Main(string[] args) { RandomIntegerStringGenerator randomIntegerStringGenerator = new RandomIntegerStringGenerator(new RandomIntegerListGenerator(), 1, 100); string myRandomIntegerString = randomIntegerStringGenerator.GetRandomIntegerString(5); Console.Write(myRandomIntegerString); Console.ReadLine(); }
public void String_Contains_Comma_Seperated_List_Of_Expected_Numbers() { //Arrange int numOfIntegers = 5; int minValue = 1; int maxValue = 100; var mockRandomListGenerator = new Mock<IRandomIntegerListGenerator>(); mockRandomListGenerator.Setup(x => x.GetRandomIntegers(numOfIntegers, minValue, maxValue)).Returns(new List<int> { 10, 55, 26, 14, 15 }); RandomIntegerStringGenerator randomIntegerStringGenerator = new RandomIntegerStringGenerator(mockRandomListGenerator.Object, minValue, maxValue); //Act - system under test randomIntegerStringGenerator.getRandomIntegerString string myString = randomIntegerStringGenerator.GetRandomIntegerString(numOfIntegers); //Assert Assert.AreEqual("10,55,26,14,15", myString); }