public void TestReadToEndWithNegativeNumbers() { FibonacciTextReader fibTest = new FibonacciTextReader(-2); string output = fibTest.ReadToEnd(); Assert.That(output, Is.EqualTo(string.Empty)); }
public void TestReadToEndWithZero() { FibonacciTextReader fibTest = new FibonacciTextReader(0); string output = fibTest.ReadToEnd(); Assert.That(output, Is.EqualTo(string.Empty)); }
public void TestReadToEndWithSpecialCases() { FibonacciTextReader fibTest = new FibonacciTextReader(2); string output = fibTest.ReadToEnd(); int fibNumber = fibTest.NumberOfSequence; // Checks the first case of 0 if (fibNumber == 0) { Assert.That(output, Is.EqualTo("1: 0\r\n")); } // Checks the second case of 1 if (fibNumber == 1) { Assert.That(output, Is.EqualTo("1: 0\r\n" + "2: 1\r\n")); } }
//load the first 100 numbers of the Fibonacci sequence private void loadFibonacciNumbersfirst100ToolStripMenuItem_Click(object sender, EventArgs e) { FibonacciTextReader sr = new FibonacciTextReader(100); textBox1.Text = sr.ReadToEnd(); }