text: /**
   *    Copyright (C) 2015 MongoDB Inc.
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *   limitations under the License.
   */
  
  #pragma once
  
  #include "mongo/util/tick_source.h"
  #include "mongo/util/time_support.h"
  
  namespace mongo {
  
  /**
   * Mock tick source with millisecond resolution that doesn't gives a fixed tick count
   * until the advance method is called.
   */
  class TickSourceMock final : public TickSource {
  public:
      TickSource::Tick getTicks() override;
  
      TickSource::Tick getTicksPerSecond() override;
  
      /**
       * Advance the ticks by the given amount of milliseconds.
       */
      void advance(const Milliseconds& ms);
  
      /**
       * Resets the tick count to the give value.
       */
      void reset(TickSource::Tick tick);
  
  private:
      TickSource::Tick _currentTicks = 0;
  };
  }  // namespace mongo
  