Skip to content

Commit c561e61

Browse files
committed
Fix #65 and #54
1 parent 4fa819e commit c561e61

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

TestStack.ConventionTests/Conventions/ClassTypeHasSpecificNamespace.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace TestStack.ConventionTests.Conventions
22
{
33
using System;
4+
using System.Linq;
45
using TestStack.ConventionTests.ConventionData;
56

67
/// <summary>
@@ -38,7 +39,7 @@ public void Execute(Types data, IConventionResultContext result)
3839
string.Format("Non-{0}s must not be under the '{1}' namespace", classType, namespaceToCheck),
3940
classIsApplicable,
4041
TypeLivesInSpecifiedNamespace,
41-
data.TypesToVerify);
42+
data.TypesToVerify.Where(t => !t.IsCompilerGenerated()));
4243
}
4344

4445
public string ConventionReason
@@ -48,7 +49,7 @@ public string ConventionReason
4849

4950
bool TypeLivesInSpecifiedNamespace(Type t)
5051
{
51-
return t.Namespace == null || t.Namespace.StartsWith(namespaceToCheck);
52+
return t.Namespace == null || (t.Namespace.StartsWith(namespaceToCheck + ".") || t.Namespace == namespaceToCheck);
5253
}
5354
}
5455
}

0 commit comments

Comments
 (0)