diff --git a/src/NExpect.Matchers.AspNetCore.Tests/TestPeanutButterProperlyImported.cs b/src/NExpect.Matchers.AspNetCore.Tests/TestPeanutButterProperlyImported.cs new file mode 100644 index 0000000..f7d0541 --- /dev/null +++ b/src/NExpect.Matchers.AspNetCore.Tests/TestPeanutButterProperlyImported.cs @@ -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(); + } +} \ No newline at end of file diff --git a/src/NExpect.Matchers.AspNetMvc.Tests/GlobalUsings.cs b/src/NExpect.Matchers.AspNetMvc.Tests/GlobalUsings.cs new file mode 100644 index 0000000..2b32db8 --- /dev/null +++ b/src/NExpect.Matchers.AspNetMvc.Tests/GlobalUsings.cs @@ -0,0 +1,2 @@ +global using NExpect; +global using static NExpect.Expectations; \ No newline at end of file diff --git a/src/NExpect.Matchers.AspNetMvc.Tests/TestActionResultMatchers.cs b/src/NExpect.Matchers.AspNetMvc.Tests/TestActionResultMatchers.cs index 783dbbf..f59d28d 100644 --- a/src/NExpect.Matchers.AspNetMvc.Tests/TestActionResultMatchers.cs +++ b/src/NExpect.Matchers.AspNetMvc.Tests/TestActionResultMatchers.cs @@ -3,7 +3,6 @@ using static PeanutButter.RandomGenerators.RandomValueGen; using NExpect.Exceptions; using PeanutButter.Utils; -using static NExpect.Expectations; namespace NExpect.Matchers.AspNetMvc.Tests; diff --git a/src/NExpect.Matchers.AspNetMvc.Tests/TestControllerMatchers.cs b/src/NExpect.Matchers.AspNetMvc.Tests/TestControllerMatchers.cs index 129dc04..0d36b65 100644 --- a/src/NExpect.Matchers.AspNetMvc.Tests/TestControllerMatchers.cs +++ b/src/NExpect.Matchers.AspNetMvc.Tests/TestControllerMatchers.cs @@ -2,7 +2,6 @@ using System.Web.Mvc; using NExpect.Exceptions; using NUnit.Framework; -using static NExpect.Expectations; namespace NExpect.Matchers.AspNetMvc.Tests; diff --git a/src/NExpect.Matchers.AspNetMvc.Tests/TestHttpResponseMessageMatchers.cs b/src/NExpect.Matchers.AspNetMvc.Tests/TestHttpResponseMessageMatchers.cs index 1b3ca38..c304a59 100644 --- a/src/NExpect.Matchers.AspNetMvc.Tests/TestHttpResponseMessageMatchers.cs +++ b/src/NExpect.Matchers.AspNetMvc.Tests/TestHttpResponseMessageMatchers.cs @@ -2,7 +2,6 @@ using NExpect.Exceptions; using NUnit.Framework; using static PeanutButter.RandomGenerators.RandomValueGen; -using static NExpect.Expectations; namespace NExpect.Matchers.AspNetMvc.Tests; diff --git a/src/NExpect.Matchers.AspNetMvc.Tests/TestPeanutButterProperlyImported.cs b/src/NExpect.Matchers.AspNetMvc.Tests/TestPeanutButterProperlyImported.cs new file mode 100644 index 0000000..ae072eb --- /dev/null +++ b/src/NExpect.Matchers.AspNetMvc.Tests/TestPeanutButterProperlyImported.cs @@ -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(); + } +} \ No newline at end of file diff --git a/src/NExpect.Tests/TestPeanutButterProperlyImported.cs b/src/NExpect.Tests/TestPeanutButterProperlyImported.cs new file mode 100644 index 0000000..881aa61 --- /dev/null +++ b/src/NExpect.Tests/TestPeanutButterProperlyImported.cs @@ -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(); + } +} \ No newline at end of file diff --git a/src/PeanutButter b/src/PeanutButter index 2b32c78..ebc7a4c 160000 --- a/src/PeanutButter +++ b/src/PeanutButter @@ -1 +1 @@ -Subproject commit 2b32c78cc8e781743181c1df92cab937fdbf75c8 +Subproject commit ebc7a4c8de1d1d51c331565a2f02b0d3a01683c3