public void UnofficialAppleHeadsetWithoutOutput() { //Arrange var headset = new UnofficialAppleHeadset(null); var expect = "No Output!"; //Act var actual = headset.Play(new object()); //Assert Assert.AreEqual(expect, actual); }
public void UnofficialAppleHeadsetIsPlaying() { //Arrange IOutput output = new FakeOutput(); var headset = new UnofficialAppleHeadset(output); var expect = "Test Output is running"; //Act var actual = headset.Play(new object()); //Assert Assert.AreEqual(expect, actual); }
public string SelectPlaybackComponent(int index) { var selectionBuilder = new StringBuilder(); switch (index) { case 1: PlaybackComponent = new AppleHeadset(Output); selectionBuilder.AppendLine(Output.WriteLine("Apple Headset playback selected")); break; case 2: PlaybackComponent = new SamsungHeadset(Output); selectionBuilder.AppendLine(Output.WriteLine("Samsung Headset playback selected")); break; case 3: PlaybackComponent = new UnofficialAppleHeadset(Output); selectionBuilder.AppendLine(Output.WriteLine("Unofficial Apple Headset playback selected")); break; case 4: PlaybackComponent = Speaker; Speaker.Output = Output; selectionBuilder.AppendLine(Output.WriteLine("Speaker playback selected")); break; default: selectionBuilder.AppendLine(Output.WriteLine("No playback selected")); break; } if (PlaybackComponent != null) { selectionBuilder.AppendLine(Output.WriteLine($"Set playback to {nameof(Mobile)}...")); } return(selectionBuilder.ToString()); }