This is an automated email from the ASF dual-hosted git repository. davydm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
commit 84a4d0c851e8c7dc47bbd7d8264a5260d75138c3 Author: Davyd McColl <[email protected]> AuthorDate: Fri Jul 22 12:59:48 2022 +0200 :white_check_mark: prove that FixingFlags.All contains all other valid fixing flags --- src/log4net.Tests/Core/FixingTest.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/log4net.Tests/Core/FixingTest.cs b/src/log4net.Tests/Core/FixingTest.cs index eb28150c..d122344f 100644 --- a/src/log4net.Tests/Core/FixingTest.cs +++ b/src/log4net.Tests/Core/FixingTest.cs @@ -18,11 +18,14 @@ #endregion using System; +using System.Linq; using System.Threading; using log4net.Core; using NUnit.Framework; +using static NExpect.Expectations; +using NExpect; namespace log4net.Tests.Core { @@ -57,6 +60,22 @@ namespace log4net.Tests.Core } } + [Test] + public void All_ShouldContainAllFlags() + { + // Arrange + // Act + var allFlags = Enum.GetValues(typeof(FixFlags)).Cast<FixFlags>() + .Except(new[] { FixFlags.None }) + .ToArray(); + // Assert + foreach (var flag in allFlags) + { + Expect(FixFlags.All & flag) + .To.Equal(flag, () => $"FixFlags.All does not contain {flag}"); + } + } + [Test] public void TestUnfixedValues() {
