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); }
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); }