예제 #1
0
        public void CheckInputAndOutputUnofficialHeadsetValue()
        {
            var output = new TestableOutput();
            UnofficialiPhoneHeadset unofficialiPhoneHeadset = new UnofficialiPhoneHeadset(output);

            string inputValue = $"Madonna Song";

            unofficialiPhoneHeadset.Play(inputValue);

            string outputValue   = output.WritenLineText;
            string expectedValue = $"{nameof(UnofficialiPhoneHeadset)} play {inputValue}";

            Assert.AreEqual(expectedValue, outputValue);
        }
        public void TestUnofficialiPhoneHeadset()
        {
            //Arrange
            Init();
            UnofficialiPhoneHeadset iPhone = new UnofficialiPhoneHeadset(_testoutput);

            //Act
            iPhone.Play(null);

            //Assert
            string expected = "UnofficialiPhoneHeadset sound";

            Assert.AreEqual(_testoutput.CapturedOutput, expected);
        }
예제 #3
0
        public void UnofficialiPhoneHeadsetPlay()
        {
            // Arrange
            string                  actualOutput            = "";
            OutputForTesting        VariableOutput          = new OutputForTesting(actualOutput);
            UnofficialiPhoneHeadset UnofficialiPhoneHeadset = new UnofficialiPhoneHeadset(VariableOutput);

            string expectedOutput = $"{nameof(UnofficialiPhoneHeadset)} sound";

            // Act
            UnofficialiPhoneHeadset.Play(new Object());
            actualOutput = VariableOutput.OutputVariable;

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