Exemple #1
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));
        }
Exemple #2
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));
        }
Exemple #3
0
        public static void Test_Command_Pause_CanExecute_True()
        {
            IPlayerController pc = A.Fake <IPlayerController>();

            A.CallTo(() => pc.CurrentState).Returns(PlayerState.Playing);

            PlayerCommands commands = new PlayerCommands(pc, A.Fake <ITrackAvailability>(), A.Fake <ITrackNavigation>());

            UnitTest.Test(commands.PauseCommand.CanExecute(null));
        }
Exemple #4
0
        public static void Test_Command_Stop_CanExecute_False()
        {
            IPlayerController pc = A.Fake <IPlayerController>();

            A.CallTo(() => pc.CurrentState).Returns(PlayerState.Stopped);

            PlayerCommands commands = new PlayerCommands(pc, A.Fake <ITrackAvailability>(), A.Fake <ITrackNavigation>());

            UnitTest.Test(!commands.StopCommand.CanExecute(null));
        }
Exemple #5
0
        public static void Test_Command_Pause_Execute()
        {
            IPlayerController pc = A.Fake <IPlayerController>();

            A.CallTo(() => pc.CurrentState).Returns(PlayerState.Playing);

            PlayerCommands commands = new PlayerCommands(pc, A.Fake <ITrackAvailability>(), A.Fake <ITrackNavigation>());

            commands.PauseCommand.Execute(null);

            A.CallTo(() => pc.Pause()).MustHaveHappened();
        }
Exemple #6
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();
        }