test(notification-outbox): fold notification enum tests into EnumTests convention
This commit is contained in:
@@ -12,6 +12,8 @@ public class EnumTests
|
|||||||
[InlineData(typeof(AlarmLevel), new[] { "None", "Low", "LowLow", "High", "HighHigh" })]
|
[InlineData(typeof(AlarmLevel), new[] { "None", "Low", "LowLow", "High", "HighHigh" })]
|
||||||
[InlineData(typeof(AlarmTriggerType), new[] { "ValueMatch", "RangeViolation", "RateOfChange", "HiLo", "Expression" })]
|
[InlineData(typeof(AlarmTriggerType), new[] { "ValueMatch", "RangeViolation", "RateOfChange", "HiLo", "Expression" })]
|
||||||
[InlineData(typeof(ConnectionHealth), new[] { "Connected", "Disconnected", "Connecting", "Error" })]
|
[InlineData(typeof(ConnectionHealth), new[] { "Connected", "Disconnected", "Connecting", "Error" })]
|
||||||
|
[InlineData(typeof(NotificationStatus), new[] { "Pending", "Retrying", "Delivered", "Parked", "Discarded" })]
|
||||||
|
[InlineData(typeof(NotificationType), new[] { "Email" })]
|
||||||
public void Enum_ShouldHaveExpectedValues(Type enumType, string[] expectedNames)
|
public void Enum_ShouldHaveExpectedValues(Type enumType, string[] expectedNames)
|
||||||
{
|
{
|
||||||
var actualNames = Enum.GetNames(enumType);
|
var actualNames = Enum.GetNames(enumType);
|
||||||
@@ -26,6 +28,8 @@ public class EnumTests
|
|||||||
[InlineData(typeof(AlarmLevel))]
|
[InlineData(typeof(AlarmLevel))]
|
||||||
[InlineData(typeof(AlarmTriggerType))]
|
[InlineData(typeof(AlarmTriggerType))]
|
||||||
[InlineData(typeof(ConnectionHealth))]
|
[InlineData(typeof(ConnectionHealth))]
|
||||||
|
[InlineData(typeof(NotificationStatus))]
|
||||||
|
[InlineData(typeof(NotificationType))]
|
||||||
public void Enum_ShouldBeSingularNamed(Type enumType)
|
public void Enum_ShouldBeSingularNamed(Type enumType)
|
||||||
{
|
{
|
||||||
// Singular names should not end with 's' (except 'Status' which is singular)
|
// Singular names should not end with 's' (except 'Status' which is singular)
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
using ScadaLink.Commons.Types.Enums;
|
|
||||||
|
|
||||||
namespace ScadaLink.Commons.Tests.Types;
|
|
||||||
|
|
||||||
public class NotificationEnumTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void NotificationStatus_HasExactlyTheCentralStates()
|
|
||||||
{
|
|
||||||
var names = Enum.GetNames<NotificationStatus>();
|
|
||||||
Assert.Equal(
|
|
||||||
new[] { "Pending", "Retrying", "Delivered", "Parked", "Discarded" },
|
|
||||||
names);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void NotificationType_HasEmail()
|
|
||||||
{
|
|
||||||
Assert.True(Enum.IsDefined(NotificationType.Email));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user