Unit-Test erweitert, NetRevisionTask aktualisiert, ExceptionTests hinzugefügt...
This commit is contained in:
@@ -7,6 +7,7 @@ using DescriptionAttribute = System.ComponentModel.DescriptionAttribute;
|
||||
namespace AMWD.Common.Tests.Extensions
|
||||
{
|
||||
[TestClass]
|
||||
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
|
||||
public class EnumExtensionsTests
|
||||
{
|
||||
[TestMethod]
|
||||
@@ -93,6 +94,19 @@ namespace AMWD.Common.Tests.Extensions
|
||||
Assert.AreEqual(enumWithoutDescripton.ToString(), noDescription);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ShouldReturnEmptyListOnNotDefinedEnumValue()
|
||||
{
|
||||
// arrange
|
||||
var notDefinedEnum = (TestEnum)10;
|
||||
|
||||
// act
|
||||
var list = notDefinedEnum.GetAttributes<DescriptionAttribute>();
|
||||
|
||||
// assert
|
||||
Assert.IsFalse(list.Any());
|
||||
}
|
||||
|
||||
internal enum TestEnum
|
||||
{
|
||||
[CustomMultiple("nix")]
|
||||
|
||||
Reference in New Issue
Block a user