/// <summary>
        /// Initializes a new instance of the <see cref="GCD"/> class.
        /// </summary>
        /// <param name="algorithm">The algorithm.</param>
        /// <param name="stopWatcher">The stop watcher.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Throws if stopWatcher or logger is null.
        /// </exception>
        public GCD(IAlgorithm algorithm, IStopWatcher stopWatcher, ILogger logger) : base(algorithm)
        {
            _stopWatcher = stopWatcher ?? throw new ArgumentNullException($"{nameof(stopWatcher)} can't be null.");
            _logger      = logger ?? throw new ArgumentNullException($"{nameof(logger)} can't be null.");

            Milliseconds = 0;
        }
 public TimeDecorator(IAlgorithm algorithm, IStopWatcher stopWatch)
 {
     this.algorithm = algorithm;
     this.stopWatch = stopWatch;
 }
Example #3
0
 public void Setup()
 {
     _logger      = Mock.Of <ILogger>();
     _stopWatcher = Mock.Of <IStopWatcher>();
     _algorithm   = Mock.Of <IAlgorithm>();
 }
 private void Create()
 {
     this.stopwatch = new StopWatcher();
 }