-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ enforce correct namespacing for imported PB code via tests
- Loading branch information
1 parent
fbcc73f
commit efacbae
Showing
8 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/NExpect.Matchers.AspNetCore.Tests/TestPeanutButterProperlyImported.cs
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,25 @@ | ||
using System.Linq; | ||
using PeanutButter.Utils; | ||
|
||
namespace NExpect.Matchers.AspNet.Tests; | ||
|
||
[TestFixture] | ||
public class TestPeanutButterProperlyImported | ||
{ | ||
[TestCase("PeanutButter.")] | ||
public void ShouldNotExportNamespaceStartingWith_( | ||
string prefix | ||
) | ||
{ | ||
// Arrange | ||
// Act | ||
var invalid = typeof(Expectations) | ||
.GetAssembly() | ||
.GetTypes() | ||
.Where(t => t.Namespace?.StartsWith(prefix) ?? false) | ||
.ToArray(); | ||
// Assert | ||
Expect(invalid) | ||
.To.Be.Empty(); | ||
} | ||
} |
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,2 @@ | ||
global using NExpect; | ||
global using static NExpect.Expectations; |
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
26 changes: 26 additions & 0 deletions
26
src/NExpect.Matchers.AspNetMvc.Tests/TestPeanutButterProperlyImported.cs
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,26 @@ | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using PeanutButter.Utils; | ||
|
||
namespace NExpect.Matchers.AspNetMvc.Tests; | ||
|
||
[TestFixture] | ||
public class TestPeanutButterProperlyImported | ||
{ | ||
[TestCase("PeanutButter.")] | ||
public void ShouldNotExportNamespaceStartingWith_( | ||
string prefix | ||
) | ||
{ | ||
// Arrange | ||
// Act | ||
var invalid = typeof(Expectations) | ||
.GetAssembly() | ||
.GetTypes() | ||
.Where(t => t.Namespace?.StartsWith(prefix) ?? false) | ||
.ToArray(); | ||
// Assert | ||
Expect(invalid) | ||
.To.Be.Empty(); | ||
} | ||
} |
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,26 @@ | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using PeanutButter.Utils; | ||
|
||
namespace NExpect.Tests; | ||
|
||
[TestFixture] | ||
public class TestPeanutButterProperlyImported | ||
{ | ||
[TestCase("PeanutButter.")] | ||
public void ShouldNotExportNamespaceStartingWith_( | ||
string prefix | ||
) | ||
{ | ||
// Arrange | ||
// Act | ||
var invalid = typeof(Expectations) | ||
.GetAssembly() | ||
.GetTypes() | ||
.Where(t => t.Namespace?.StartsWith(prefix) ?? false) | ||
.ToArray(); | ||
// Assert | ||
Expect(invalid) | ||
.To.Be.Empty(); | ||
} | ||
} |
Submodule PeanutButter
updated
35 files