Exemple #1
0
        public void ChargeValidOutputText()
        {
            FakeOutput      output  = new FakeOutput();
            WirelessCharger charger = new WirelessCharger(output, 1.5f);

            charger.Charge();

            Assert.AreEqual("Charge with WirelessCharger\n", output.OutputResult);
        }
Exemple #2
0
        public void WirelessChargerTest()
        {
            ///Arrange
            double          voltage                 = 5;
            double          amperage                = 1;
            FakeOutput      fakeOutput              = new FakeOutput();
            WirelessCharger wirelessCharger         = new WirelessCharger(fakeOutput);
            string          expectedWriteLineResult = "WirelessCharger wireless charge (5 V, 1 A)";

            //Act
            wirelessCharger.Charge(voltage, amperage);
            string writeLinedResult = fakeOutput.WriteLineResult;

            //Assert
            Assert.AreEqual(writeLinedResult, expectedWriteLineResult);
        }