-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BenMorris/NetArchTest#120 - Add support for records and init-only pro…
…perties
- Loading branch information
Showing
7 changed files
with
38 additions
and
5 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 |
---|---|---|
|
@@ -656,10 +656,11 @@ public void AreImmutable_MatchesFound_ClassSelected() | |
.And() | ||
.AreImmutable().GetReflectionTypes(); | ||
|
||
Assert.Equal(3, result.Count()); // Three types found | ||
Assert.Equal(4, result.Count()); // Three types found | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NeVeSpl
Author
Owner
|
||
Assert.Contains<Type>(typeof(ImmutableClass1), result); | ||
Assert.Contains<Type>(typeof(ImmutableClass2), result); | ||
Assert.Contains<Type>(typeof(ImmutableClass3), result); | ||
Assert.Contains<Type>(typeof(ImmutableRecord1), result); | ||
} | ||
|
||
[Fact(DisplayName = "Types can be selected for being mutable.")] | ||
|
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
using System.Runtime.CompilerServices; | ||
[assembly: InternalsVisibleTo("NetArchTest.UnitTests")] | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
internal static class IsExternalInit { } | ||
} |
10 changes: 10 additions & 0 deletions
10
test/NetArchTest.TestStructure/Mutability/ImmutableRecord1.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,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NetArchTest.TestStructure.Mutability | ||
{ | ||
public record ImmutableRecord1(int Property) | ||
{ | ||
} | ||
} |
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
It's not very constructive, but the comment should be also changed to "Four types found"