Beispiel #1
0
        public void iPhoneHeadsetTest()
        {
            ///Arrange
            FakeOutput    fakeOutput = new FakeOutput();
            iPhoneHeadset iPHeadset  = new iPhoneHeadset(fakeOutput);
            string        songName   = "Test Artist - Test Song";
            string        expectedWriteLineResult = "iPhoneHeadset sound: Test Artist - Test Song";

            //Act
            iPHeadset.Play(songName);
            string writeLinedResult = fakeOutput.WriteLineResult;

            //Assert
            Assert.AreEqual(writeLinedResult, expectedWriteLineResult);
        }
Beispiel #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);
        }