コード例 #1
0
        public void GcdSteinsAlgorithmTests_ArgumentException(int expected, params int[] numbers)
        {
            // Arrange
            double executionTime;

            // Act
            // Assert
            Assert.ThrowsException <ArgumentException>(() => EuclidsAlgorithmRefactoring.GcdEuclidsAlgorithm(out executionTime, numbers));
        }
コード例 #2
0
        public void GcdEuclidsAlgorithmTests(int expected, params int[] numbers)
        {
            // Arrange
            double executionTime;

            // Act
            int gcd = EuclidsAlgorithmRefactoring.GcdEuclidsAlgorithm(out executionTime, numbers);

            // Assert
            Assert.AreEqual(expected, gcd);
            Assert.IsTrue(executionTime < 100);
        }