diff --git a/src/NetArchTest.Rules/NetArchTest.csproj b/src/NetArchTest.Rules/NetArchTest.csproj index 74b1dc2..dbdfcf7 100644 --- a/src/NetArchTest.Rules/NetArchTest.csproj +++ b/src/NetArchTest.Rules/NetArchTest.csproj @@ -5,7 +5,7 @@ 1.3.4 NeVeSpl NetArchTest.eNhancedEdition - A fluent API for .Net Standard that can enforce architectural rules in unit tests. + A fluent API for .Net Standard that can enforce architectural rules in unit tests. Improved version, built upon NetArchTest.Rules v1.3.2. (c) NetArchTest.eNhancedEdition https://github.com/NeVeSpl/NetArchTest.eNhancedEdition/blob/master/LICENSE https://github.com/NeVeSpl/NetArchTest.eNhancedEdition diff --git a/src/NetArchTest.Rules/TestResult.cs b/src/NetArchTest.Rules/TestResult.cs index 396f81a..7435d1e 100644 --- a/src/NetArchTest.Rules/TestResult.cs +++ b/src/NetArchTest.Rules/TestResult.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using NetArchTest.Assemblies; @@ -27,7 +28,7 @@ private TestResult() /// /// This method loads all the types and may throw dependency loading errors if the test project does not have a direct dependency on the type being loaded. /// - public IReadOnlyList FailingTypes { get; private set; } + public IReadOnlyList FailingTypes { get; private set; } = Array.Empty(); /// diff --git a/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs b/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs index c3f37ff..89e0198 100644 --- a/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs +++ b/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs @@ -144,8 +144,8 @@ public void GetResult_FailedShouldNot_ReturnFailedTypes() Assert.Contains(typeof(ClassA3), result.FailingTypes.Select(x => x.ReflectionType)); } - [Fact(DisplayName = "If a condition succeeds then a list of failing types should be null.")] - public void GetResult_Success_ReturnNullFailedTypes() + [Fact(DisplayName = "If a condition succeeds then a list of failing types should be empty.")] + public void GetResult_Success_ReturnEmptyFailedTypes() { var result = Types .InAssembly(Assembly.GetAssembly(typeof(ClassA1))) @@ -162,7 +162,7 @@ public void GetResult_Success_ReturnNullFailedTypes() .GetResult(); Assert.True(result.IsSuccessful); - Assert.Null(result.FailingTypes); + Assert.Empty(result.FailingTypes); } } }