public void Test_if_TurnOn_is_correct_input(int power)
 {
     //SetUp
     //Act
     _uut.TurnOn(power);
     //Assert
     _output.Received().OutputLine(Arg.Is <string>(x => x.Contains($"PowerTube works with {power} Watt")));
 }
        public void PowerTupe_WhenTurnedOff_OutputLineContainsTurnedOff()
        {
            sut.TurnOn(10);

            sut.TurnOff();

            var _consoleOutput = readConsole.ToString();

            Assert.That(_consoleOutput.Contains("PowerTube turned off"));
        }
        public void TurnOn_CorrectPower()
        {
            var output = new StringWriter();

            Console.SetOut(output);

            _powerTube.TurnOn(50);

            string expectedResult = "PowerTube works with 50\r\n";

            Assert.That(output.ToString(), Is.EqualTo(expectedResult));
        }
        public void TurnOn_WasOff_CorrectOutput()
        {
            uut.TurnOn(50);
            double percent = ((double)50 / 700) * 100;

            output.Received().OutputLine(Arg.Is <string>(str => str.Contains($"{percent} %")));
        }
Exemple #5
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     // Power forsøges udgivet i procent, derfor omregnes
     // (100/700)*50 = 7,14, afrundet til 7
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("7 %")));
 }
 public void TurnOn_WasOffCorrectPower_CorrectOutput(int power)
 {
     Console.SetOut(consoleOut);
     powertubeTM.TurnOn(power);
     Assert.That(consoleOut.ToString().Length > 0);
     //Equals($"PowerTube works with {power}\r\n"));
 }
Exemple #7
0
 public void TurnOn_WasOffCorrectPower_CorrectOutput(int power)
 {
     _uut.TurnOn(power);
     Assert.That(_stw.ToString, Contains.Substring($"{power}"));
 }
Exemple #8
0
        public void TurnOn_PowerLevelOK_Allowed(int power, string expectedOutput)
        {
            _uut.TurnOn(power);

            Assert.That(_sw.ToString(), Is.EqualTo(expectedOutput));
        }
Exemple #9
0
 public void TestForTurnOn()
 {
     power.TurnOn(50);
     StringAssert.Contains("PowerTube works with 50", stringWriter.ToString());
 }
Exemple #10
0
 public void TurnOn_Output_PowerTubeWorksWithPower(int power)
 {
     _powertube.TurnOn(power);
     Assert.That(_stringWriter.ToString().Contains("" + power));
 }
Exemple #11
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
 }
Exemple #12
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("7,1 %")));
 }
Exemple #13
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 W"))); //rettet fra procent til W
 }
Exemple #14
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     _powerTube.TurnOn(50);
     _output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 W")));
 }
Exemple #15
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 W")));
     //Ændret til W i stedet for %
 }
 public void TurnOn()
 {
     PT_.TurnOn(50);
     StringAssert.Contains("PowerTube works with 50", SW_.ToString());
 }
Exemple #17
0
 public void TurnOff_OutputLine_displays_PowerTubeTurnedOff()
 {
     _powerTube.TurnOn(60);
     _powerTube.TurnOff();
     Assert.That(!_stringWriter.ToString().Contains("off"));
 }
Exemple #18
0
 public void PowerTube_TurnOn_WasOffCorrectPower_CorrectOutput(int power)
 {
     powertube.TurnOn(power);
     OutputLineCorrect($"{power}");
 }
        public void TurnOn_WasOff_CorrectOutput()
        {
            uut.TurnOn(350); //Power er blevet sat op fra 50 til 350 watt for at ramme de 50 %

            output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 %")));
        }
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     // 50% ud af 700 = 7% (afrundet)
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("7 %")));
 }
Exemple #21
0
 public void PowerTubeIsOff_TurnOn(int power)
 {
     sut.TurnOn(power);
     Assert.That(stringWriter.ToString().Contains($"{power}") && stringWriter.ToString().Contains("PowerTube works"));
 }
Exemple #22
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     // Parameter changed from 50 to 350, 50% of 700 is 350
     uut.TurnOn(350);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 %")));
 }
Exemple #23
0
 public void TurnOn_WasOffCorrectPower_CorrectOutput(int power)
 {
     uut.TurnOn(power);
     Assert.That(str.ToString().Contains($"PowerTube works with {power}"));
 }
Exemple #24
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 watt"))); //fixed - watt not %
 }
Exemple #25
0
 public void TurnOn_WasOffCorrectPower_CorrectOutput(int power)
 {
     uut.TurnOn(power);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains($"{power}")));
 }
 public void CookController_PowerTubeAboveLimit_ThrowsExceptionIsCalled(int power, int timer)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => _powerTube.TurnOn(power));
 }
Exemple #27
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50 W"))); //Rettelse af 50 % lavet om til 50 W
 }
Exemple #28
0
 public void TurnOn_WasOff_CorrectOutput()
 {
     //Da der er ændret i powertube fra procent til watt, skal der ikke stå % tegn
     uut.TurnOn(50);
     output.Received().OutputLine(Arg.Is <string>(str => str.Contains("50")));
 }