Exemplo n.º 1
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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
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();
        }