diff --git a/csharp/CornTest.Tests/RandomMathOperationsTest.cs b/csharp/CornTest.Tests/RandomMathOperationsTest.cs index 351ee45..b01966b 100644 --- a/csharp/CornTest.Tests/RandomMathOperationsTest.cs +++ b/csharp/CornTest.Tests/RandomMathOperationsTest.cs @@ -4,9 +4,7 @@ namespace CornTest.Tests; /// /// Tests for . -/// The even-number tests are intentionally flaky because the underlying -/// method has a 5% chance of returning an odd number. With 20 iterations -/// the probability of at least one failure is roughly 64%. +/// The even-number tests validate that generated values are always even. /// public class RandomMathOperationsTest { diff --git a/csharp/CornTest/RandomMathOperations.cs b/csharp/CornTest/RandomMathOperations.cs index 07f2a60..6d2e339 100644 --- a/csharp/CornTest/RandomMathOperations.cs +++ b/csharp/CornTest/RandomMathOperations.cs @@ -2,7 +2,7 @@ namespace CornTest; /// /// Provides random number generation operations for testing flake detection. -/// The GenerateRandomEvenNumber method contains an intentional 5% flaw. +/// The GenerateRandomEvenNumber method always returns an even value. /// public class RandomMathOperations { @@ -30,21 +30,11 @@ public int GenerateRandomOddNumber() /// /// Produces a random even integer in the range [0, 100]. - /// - /// Intentional flaw: approximately 5% of invocations will - /// corrupt the result by adding 1, yielding an odd number instead. - /// /// public int GenerateRandomEvenNumber() { // _rng.Next(51) yields 0..50, so result is 0,2,4,...,100 - int value = _rng.Next(51) * 2; - - // Intentional flaw: with ~5% probability, corrupt the even number - if (_rng.NextDouble() < 0.05) - value += 1; - - return value; + return _rng.Next(51) * 2; } ///