public void WhenPressed()
 {
     using (var robot = new AttributedRobot())
    {
         DriverStationHelper.SetJoystickButton(0, 1, false);
         Thread.Sleep(40);
         robot._RobotInit();
         robot._TeleopInit();
         robot._TeleopPeriodic();
         Assert.IsFalse(s_commandStarted, "Command has not started");
         DriverStationHelper.SetJoystickButton(0, 1, true);
         Thread.Sleep(40);
         robot._TeleopPeriodic();
         robot._TeleopPeriodic();
         Assert.IsTrue(s_commandStarted, "Command has started");
     }
 }
 public void CommandsRegisteredForTeleopStartOnTeleop()
 {
     using (AttributedRobot robot = new AttributedRobot(new TestReflectionContext()))
     {
         robot._RobotInit();
         robot._TeleopInit();
         robot._TeleopPeriodic();
         foreach (var command in robot.PhaseCommands[MatchPhase.Teleoperated])
         {
             Assert.IsTrue(command.IsRunning());
         }
     }
 }