diff --git a/src/NetArchTest.Rules/TestResult.cs b/src/NetArchTest.Rules/TestResult.cs index bbbbbcd..c9209ac 100644 --- a/src/NetArchTest.Rules/TestResult.cs +++ b/src/NetArchTest.Rules/TestResult.cs @@ -49,7 +49,8 @@ public IReadOnlyList<string> FailingTypeNames internal static TestResult Success() => new TestResult { - IsSuccessful = true + IsSuccessful = true, + _failingTypes = new List<TypeDefinition>(0), }; /// <summary> diff --git a/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs b/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs index 31cf2fc..33ec27a 100644 --- a/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs +++ b/test/NetArchTest.Rules.UnitTests/ConditionListTests.cs @@ -143,8 +143,8 @@ public void GetResult_FailedShouldNot_ReturnFailedTypes() Assert.Contains<Type>(typeof(ClassA3), result.FailingTypes); } - [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))) @@ -161,7 +161,8 @@ public void GetResult_Success_ReturnNullFailedTypes() .GetResult(); Assert.True(result.IsSuccessful); - Assert.Null(result.FailingTypes); + Assert.NotNull(result.FailingTypes); + Assert.Empty(result.FailingTypes); } } }