コード例 #1
0
        public void TurnOff_WasOn_CorrectOutput()
        {
            powertubeTM.TurnOn(50); //unless powertube IsOn=true; no action/output on TurnOff()

            Console.SetOut(consoleOut);
            powertubeTM.TurnOff();
            Assert.That(consoleOut.ToString().Length > 0);
            //Equals($"PowerTube turned off"));
        }
コード例 #2
0
        public void TurnOff_PowerTubeIsOff()
        {
            var output = new StringWriter();

            Console.SetOut(output);

            _powerTube.TurnOff();

            string expectedResult = "";

            Assert.That(output.ToString(), Is.EqualTo(expectedResult));
        }
コード例 #3
0
 public void TurnOff_IsAlreadyOn_Allowed()
 {
     _uut.TurnOn(100);
     _sw.GetStringBuilder().Clear();
     _uut.TurnOff();
     Assert.That(() => _sw.ToString(), Is.EqualTo("PowerTube turned off\r\n"));
 }
コード例 #4
0
 public void Test_if_TurnOf_works(int power)
 {
     //SetUp
     _uut.TurnOn(power);
     //Act
     _uut.TurnOff();
     //Assert
     _output.Received().OutputLine(Arg.Is <string>(x => x.Contains("PowerTube turned off")));
 }
コード例 #5
0
        public void PowerTupe_WhenTurnedOff_OutputLineContainsTurnedOff()
        {
            sut.TurnOn(10);

            sut.TurnOff();

            var _consoleOutput = readConsole.ToString();

            Assert.That(_consoleOutput.Contains("PowerTube turned off"));
        }
コード例 #6
0
 public void TurnOff_WasOn_CorrectOutput()
 {
     uut.TurnOn(50);
     uut.TurnOff();
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("off")));
 }
コード例 #7
0
 public void PowerTubeIsOn_TurnOffCorrectly()
 {
     sut.TurnOn(50);
     sut.TurnOff();
     Assert.That(stringWriter.ToString().Contains("turned off"));
 }
コード例 #8
0
 public void TurnOff_WasOn_CorrectOutput()
 {
     _uut.TurnOn(50);
     _uut.TurnOff();
     Assert.That(_stw.ToString, Contains.Substring("off"));
 }
コード例 #9
0
 public void TestForTurnOnTurnOff()
 {
     power.TurnOn(50);
     power.TurnOff();
     StringAssert.Contains("PowerTube turned off", stringWriter.ToString());
 }
コード例 #10
0
 public void TurnOn_TurnOff_Output_PowerTubeTurnedOff()
 {
     _powertube.TurnOn(50);
     _powertube.TurnOff();
     Assert.That(_stringWriter.ToString().Contains("off"));
 }
コード例 #11
0
 public void TurnOff_WasOff_NoOutput()
 {
     _powerTube.TurnOff();
     _output.DidNotReceive().OutputLine(Arg.Any <string>());
 }
コード例 #12
0
 public void TurnOnThenTurnOff()
 {
     PT_.TurnOn(50);
     PT_.TurnOff();
     StringAssert.Contains("PowerTube turned off", SW_.ToString());
 }
コード例 #13
0
 public void TurnOff_OutputLine_displays_PowerTubeTurnedOff()
 {
     _powerTube.TurnOn(60);
     _powerTube.TurnOff();
     Assert.That(!_stringWriter.ToString().Contains("off"));
 }
コード例 #14
0
 public void TurnOff_WasOn_CorrectOutput()
 {
     uut.TurnOn(50);
     uut.TurnOff();
 }
コード例 #15
0
 public void TurnOff_WasOn_CorrectOutput()
 {
     uut.TurnOn(50);
     uut.TurnOff();
     Assert.That(str.ToString().Contains($"PowerTube turned off"));
 }