public void ShouldReturnNoValuesForBadUpperBound() { ICustomerApi sut = new CustomerApi(); var configDictionary = new Dictionary <int, string>(); int upperBound = 0; var actualValues = sut.GetNumbers(upperBound, configDictionary); CollectionAssert.IsEmpty(actualValues); }
public void ShouldReturnNumberOfValuesEqualToUpperBound() { ICustomerApi sut = new CustomerApi(); var configDictionary = new Dictionary <int, string>(); int expectedNumberOfValues = 100; int actualNumberOfValues = sut.GetNumbers(100, configDictionary).Count(); Assert.That(actualNumberOfValues, Is.EqualTo(expectedNumberOfValues)); }
public void ShouldPrintMultipleTriggerValuesForMatchingDivisors() { ICustomerApi sut = new CustomerApi(); var configDictionary = new Dictionary <int, string>() { { 3, "test1" }, { 5, "test2" } }; string expectedTriggerOutputValue = sut.GetNumbers(50, configDictionary).ToArray()[14]; Assert.That(expectedTriggerOutputValue, Is.EqualTo("test1test2")); }
public void ShouldPrintTriggerValueForMatchingDivisors() { ICustomerApi sut = new CustomerApi(); var configDictionary = new Dictionary <int, string>() { { 3, "test" } }; string[] outputFromSut = sut.GetNumbers(50, configDictionary).ToArray(); string expectedTriggerOutputValue1 = outputFromSut[2]; string expectedTriggerOutputValue2 = outputFromSut[8]; Assert.That(expectedTriggerOutputValue1, Is.EqualTo("test")); Assert.That(expectedTriggerOutputValue2, Is.EqualTo("test")); }
static void Main(string[] args) { int upperBound = GetUpperBoundFromCustomer(); WriteInstructionsToCustomer(); var triggers = GetTriggersFromCustomer(); ICustomerApi api = new CustomerApi(); foreach (var x in api.GetNumbers(upperBound, triggers)) { Console.WriteLine(x); } WriteEndInstructionsToCustomer(); Console.ReadKey(); }