public void RetournerFizz_QuandNumberEst3() { // Act var result = _fizzBuzzClass.FizzBuzz(3); //Assert Assert.Equal("Fizz", result); }
public void Can_ConstructWith5_CallWith5_CallWith0again() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(20, 2, 4, "Mod2", "Mod4"); /* Test constructor/default values */ fbList = myFizzBuzz.FizzBuzz(50, 5, 11, "Mod5", "Mod11"); fbList = myFizzBuzz.FizzBuzz(); TestCore(fbList, 50, 5, 11, "Mod5", "Mod11"); }
public void Can_ConstructWith0_CallWith3_CallWith0again() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(); /* Test constructor/default values */ fbList = myFizzBuzz.FizzBuzz(20, 2, 4); fbList = myFizzBuzz.FizzBuzz(); TestCore(fbList, 20, 2, 4, FizzBuzzClass.default_string1, FizzBuzzClass.default_string2); }
public void CanSuriveZeroValues() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(); /* Test edge cases */ fbList = myFizzBuzz.FizzBuzz(0, 1, 1, "X", "Y"); TestCore(fbList, 0, 1, 1, "X", "Y"); fbList = myFizzBuzz.FizzBuzz(1, 0, 1, "X", "Y"); TestCore(fbList, 1, 0, 1, "X", "Y"); fbList = myFizzBuzz.FizzBuzz(1, 1, 0, "X", "Y"); TestCore(fbList, 1, 1, 0, "X", "Y"); }
public void CanHandleLargerValues() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(549100, 17, 323, "Mod333", "Mod500"); /* Test edge cases */ fbList = myFizzBuzz.FizzBuzz(); TestCore(fbList, 549100, 17, 323, "Mod333", "Mod500"); }
public void Can_ConstructWith0_CallWith0() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(); /* Test constructor/default values */ fbList = myFizzBuzz.FizzBuzz(); TestCore(fbList, FizzBuzzClass.default_upperBound, FizzBuzzClass.default_value1, FizzBuzzClass.default_value2, FizzBuzzClass.default_string1, FizzBuzzClass.default_string2); }
public void ManualTestCheck() { var fbList = new List <string>(); var myFizzBuzz = new FizzBuzzClass(); fbList = myFizzBuzz.FizzBuzz(256, 2, 4, "myFizz", "myBuzz"); Assert.That(fbList.ElementAt(1 - 1), Does.Contain("1")); Assert.That(fbList.ElementAt(2 - 1), Does.Contain("myFizz")); Assert.That(fbList.ElementAt(4 - 1), Does.Contain("myFizz")); Assert.That(fbList.ElementAt(4 - 1), Does.Contain("myBuzz")); Assert.That(fbList.ElementAt(8 - 1), Does.Contain("myFizz")); Assert.That(fbList.ElementAt(8 - 1), Does.Contain("myBuzz")); Assert.That(fbList.ElementAt(256 - 1), Does.Contain("myFizz")); Assert.That(fbList.ElementAt(256 - 1), Does.Contain("myBuzz")); Assert.That(fbList.Count, Is.EqualTo(256)); }
static void Main(string[] args) { var myFizzBuzz = new FizzBuzzClass(); var fbList = new List <string>(); /* Call the FB producer */ fbList = myFizzBuzz.FizzBuzz(); /* Consume by writing to console */ if (fbList != null) { foreach (string fizzBuzz in fbList) { if (fizzBuzz != null) { Console.WriteLine(fizzBuzz); } } } else { Console.WriteLine(consoleNullStringWarning); } }
public void FizzBuzz_WhenDivisibleBy5And3_ReturnFizzBuzz(int number, string result) { var test = FizzBuzzClass.FizzBuzz(number); Assert.Equal(result, test); }