Ejemplo n.º 1
0
 public void AfterUserHasAnsweredR_PrintsFirstRectangleQuestion()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     ui.Process();
     consoleAdapter.UserInput = "R";
     ui.Process();
     Assert.AreEqual("Rectangle side A length?", consoleAdapter.CurrentLine);
 }
Ejemplo n.º 2
0
 public void AfterUserHasAnsweredC_PrintsCircleQuestion()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     ui.Process();
     consoleAdapter.UserInput = "C";
     ui.Process();
     Assert.AreEqual("Circle radius?", consoleAdapter.CurrentLine);
 }
Ejemplo n.º 3
0
 public void AfterUserHasAnsweredCAndThen1_PrintsPi()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     ui.Process();
     consoleAdapter.UserInput = "C";
     ui.Process();
     consoleAdapter.UserInput = "1";
     ui.Process();
     Assert.AreEqual($"{Math.PI}", consoleAdapter.CurrentLine);
 }
Ejemplo n.º 4
0
 public void AfterUserHasAnsweredRAndThen1_aPrintsNextRectangleQuestion()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     ui.Process();
     consoleAdapter.UserInput = "R";
     ui.Process();
     consoleAdapter.UserInput = "1";
     ui.Process();
     consoleAdapter.UserInput = "1";
     ui.Process();
     Assert.AreEqual("1", consoleAdapter.CurrentLine);
 }
Ejemplo n.º 5
0
 public void ForTheFirstTime_PrintsInitialQuestion()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     ui.Process();
     Assert.AreEqual("Shape: (C)ircle or (R)ectangle?", consoleAdapter.CurrentLine);
 }
Ejemplo n.º 6
0
 public void WriteOnAdapter_SetsCurrentLine()
 {
     var adapter = new ConsoleAdapter();
     adapter.Write("Shape: (C)ircle or (R)ectangle?");
     Assert.AreEqual("Shape: (C)ircle or (R)ectangle?", adapter.CurrentLine);
 }
Ejemplo n.º 7
0
 public void ForTheFirstTime_ReturnsTrue()
 {
     var consoleAdapter = new ConsoleAdapter();
     var ui = new UI(consoleAdapter);
     var result = ui.Process();
     Assert.IsTrue(result);
 }