public void test_simpleRandomQuoteProvider_returnQ_Null() { RandomQuoteProvider Provider = new SimpleRandomQuoteProvider(); var actual = Provider.returnQ(2); Assert.That(actual, Is.Not.Null.Or.Empty); }
public void test_simpleRandomQuoteProvider_returnQ() { var quoteArr = new Quote[] { new Quote(), new Quote(), }; RandomQuoteProvider Provider = new SimpleRandomQuoteProvider(); Quote[] actual = Provider.returnQ(2).Cast <Quote>().ToArray(); Assert.That(actual[0].quote, Is.EqualTo(quoteArr[0].quote)); Assert.That(actual[1].quote, Is.EqualTo(quoteArr[1].quote)); }
/// <summary> /// Testing the SimpleRandomQuoteProvider in a console app. /// </summary> /// <param name="args"></param> static void Main(string[] args) { Console.WriteLine("Please enter a valid number/integer."); RandomQuoteProvider simpleRandomQuoteObject = new SimpleRandomQuoteProvider(); var userInput = new int(); //holds user input as an int if (int.TryParse(Console.ReadLine(), out userInput)) { simpleRandomQuoteObject.returnQ(userInput); } else { Console.Error.WriteLine("Please enter a valid number/integer"); } Console.ReadKey(); }