public static void Test_Command_Previous_CanExecute_False() { ITrackAvailability ta = A.Fake <ITrackAvailability>(); A.CallTo(() => ta.HasItems()).Returns(false); PlayerCommands commands = new PlayerCommands(A.Fake <IPlayerController>(), ta, A.Fake <ITrackNavigation>()); UnitTest.Test(!commands.PreviousCommand.CanExecute(null)); }
public static void Test_Command_Next_CanExecute_True() { ITrackAvailability ta = A.Fake <ITrackAvailability>(); A.CallTo(() => ta.HasItems()).Returns(true); PlayerCommands commands = new PlayerCommands(A.Fake <IPlayerController>(), ta, A.Fake <ITrackNavigation>()); UnitTest.Test(commands.NextCommand.CanExecute(null)); }
public static void Test_Command_Play_Execute() { ITrackAvailability ta = A.Fake <ITrackAvailability>(); ITrackNavigation tn = A.Fake <ITrackNavigation>(); IPlayerController pc = A.Fake <IPlayerController>(); A.CallTo(() => ta.HasItems()).Returns(true); PlayerCommands commands = new PlayerCommands(pc, ta, tn); commands.PlayCommand.Execute(null); A.CallTo(() => pc.Play()).MustHaveHappened(); }