Beispiel #1
0
        public PlayerCommands(IPlayerController controller, ITrackAvailability trackAvailability, ITrackNavigation trackNavigation)
        {
            Controller = controller;

            TrackAvailability = trackAvailability;
            TrackNavigation   = trackNavigation;
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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();
        }