From f12e2928f23f32a15bdefaddf6831813eaf8b26d Mon Sep 17 00:00:00 2001 From: ostridm Date: Wed, 8 Feb 2023 18:06:38 +0530 Subject: [PATCH] feat(issue): extend `Severity` enum with `Critical` level closes #149 --- src/SecTester.Scan/Models/Severity.cs | 5 ++++- .../Dispatchers/MessageSerializerTests.cs | 1 + test/SecTester.Scan.Tests/ScanTests.cs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SecTester.Scan/Models/Severity.cs b/src/SecTester.Scan/Models/Severity.cs index 45071b0..d308de6 100644 --- a/src/SecTester.Scan/Models/Severity.cs +++ b/src/SecTester.Scan/Models/Severity.cs @@ -11,5 +11,8 @@ public enum Severity Medium = 2, [EnumMember(Value = "High")] - High = 3 + High = 3, + + [EnumMember(Value = "Critical")] + Critical = 4 } diff --git a/test/SecTester.Bus.Tests/Dispatchers/MessageSerializerTests.cs b/test/SecTester.Bus.Tests/Dispatchers/MessageSerializerTests.cs index d3dd94a..b035711 100644 --- a/test/SecTester.Bus.Tests/Dispatchers/MessageSerializerTests.cs +++ b/test/SecTester.Bus.Tests/Dispatchers/MessageSerializerTests.cs @@ -56,6 +56,7 @@ public class MessageSerializerTests public static readonly IEnumerable SeverityEnumerable = new List { + new object[] { Severity.Critical, @"""Critical""" }, new object[] { Severity.Medium, @"""Medium""" }, new object[] { Severity.High, @"""High""" }, new object[] { Severity.Low, @"""Low""" } diff --git a/test/SecTester.Scan.Tests/ScanTests.cs b/test/SecTester.Scan.Tests/ScanTests.cs index a1e72b7..439ead9 100644 --- a/test/SecTester.Scan.Tests/ScanTests.cs +++ b/test/SecTester.Scan.Tests/ScanTests.cs @@ -570,11 +570,11 @@ public async Task Expect_ConditionSatisfied_Returns(ScanStatus scanStatus) // arrange _scans.GetScan(ScanId).Returns(new ScanState(scanStatus), new ScanState(scanStatus) { - IssuesBySeverity = new[] { new IssueGroup(1, Severity.High) } + IssuesBySeverity = new[] { new IssueGroup(1, Severity.Critical) } }); // act - var act = () => _sut.Expect(Severity.Medium); + var act = () => _sut.Expect(Severity.Low); // assert await act.Should().NotThrowAsync();