-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29fc0e4
commit a9dec1c
Showing
9 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using FluentAssertions; | ||
using RecordParser.Extensions; | ||
using System; | ||
using System.Linq; | ||
using Xunit; | ||
|
||
namespace RecordParser.Test | ||
{ | ||
public class NamespaceTest : TestSetup | ||
{ | ||
[Fact] | ||
public void Given_public_types_inside_extensions_folder_should_not_have_namespaces_referencing_subfolder() | ||
{ | ||
// Arrange | ||
|
||
bool IsDelegate(Type type) => typeof(Delegate).IsAssignableFrom(type.BaseType); | ||
|
||
var location = "RecordParser.Extensions"; | ||
var types = typeof(WriterExtensions) | ||
.Assembly | ||
.GetTypes() | ||
.Where(x => x.IsPublic && IsDelegate(x) is false) | ||
.Where(x => x.Namespace.StartsWith(location)) | ||
.ToArray(); | ||
|
||
// Act | ||
|
||
var typesDifferentLocation = types.Where(x => x.Namespace != location); | ||
|
||
// Assert | ||
|
||
typesDifferentLocation.Should().BeEmpty(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters