예제 #1
0
        public void NokiaCharger_IsInProgress()
        {
            // Arrange / Act
            IOutput  output  = new OutputMock();
            ICharger charger = new NokiaCharger(output);

            charger.Charge(output);

            var expectedString = "NokiaCharger in progress\r\n";

            //Assert
            Assert.AreEqual(expectedString, output.Output.ToString());
        }
예제 #2
0
        public void NokiaChargerCharge()
        {
            // Arrange
            string           actualOutput   = "";
            OutputForTesting VariableOutput = new OutputForTesting(actualOutput);
            NokiaCharger     NokiaCharger   = new NokiaCharger(VariableOutput);

            string expectedOutput = $"{nameof(NokiaCharger)} is charging your phone";

            // Act
            NokiaCharger.Charge();
            actualOutput = VariableOutput.OutputVariable;

            // Assert
            Assert.AreEqual(expectedOutput, actualOutput);
        }