コード例 #1
0
 public void Calculate_TwoIntegerMinValues_ThrowArgumentOutOfRangeException() =>
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         var stopwatch = new Stopwatch();
         IGcdAlgorithm gcdAlgorithm = new BinaryGcdAlgorithm();
         gcdAlgorithm.CalculateGcdWithTime(int.MinValue, int.MinValue, new StopwatchAdapter(stopwatch), out _);
     }
    );
コード例 #2
0
 public void Calculate_TwoZeroesGiven_ThrowArgumentException() =>
    Assert.Throws<ArgumentException>(() =>
    {
        var stopwatch = new Stopwatch();
        IGcdAlgorithm gcdAlgorithm = new BinaryGcdAlgorithm();
        gcdAlgorithm.CalculateGcdWithTime(0, 0, new StopwatchAdapter(stopwatch), out _);
    }
    );      
コード例 #3
0
 public int Calculate_TwoIntegersGiven_ReturnGCD(int first, int second)
 {
     var stopwatch = new Stopwatch();
     IGcdAlgorithm gcdAlgorithm = new BinaryGcdAlgorithm();
     return gcdAlgorithm.CalculateGcdWithTime(first, second, new StopwatchAdapter(stopwatch), out _);
 }