File tree Expand file tree Collapse file tree
tests/Clean.Architecture.UnitTests/Core/ContributorAggregate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <metadata >
44 <id >Ardalis.CleanArchitecture.Template</id >
55 <title >ASP.NET Core Clean Architecture Solution</title >
6- <version >10.1 .1</version >
6+ <version >11.0.0-beta .1</version >
77 <authors >Steve Smith</authors >
88 <description >
99 The Clean Architecture Solution Template popularized by Steve @ardalis Smith. Provides a great starting point for modern and/or DDD solutions built with .NET 8 and C# 12.
1414 <projectUrl >https://github.com/ardalis/CleanArchitecture</projectUrl >
1515 <releaseNotes >
1616 * Aspire on by default
17- * Fixes issues with sln/slnx files
17+ * Updated dependencies
18+ * .NET 10
19+ * Vogen
20+ * Mediator.SourceGenerator
1821 </releaseNotes >
1922 <packageTypes >
2023 <packageType name =" Template" />
Original file line number Diff line number Diff line change 55 <TargetFramework >net10.0</TargetFramework >
66 <Nullable >enable</Nullable >
77 <ImplicitUsings >enable</ImplicitUsings >
8+ <LangVersion >latest</LangVersion >
89 </PropertyGroup >
910 <PropertyGroup >
1011 <NoWarn >1591</NoWarn > <!-- Remove this to turn on warnings for missing XML Comments -->
Original file line number Diff line number Diff line change 1+ namespace Clean . Architecture . UnitTests . Core . ContributorAggregate ;
2+
3+ public class ContributorIdFrom
4+ {
5+ [ Fact ]
6+ public void CreatesGivenValidValue ( )
7+ {
8+ int validValue = 1 ;
9+ var contributorId = ContributorId . From ( validValue ) ;
10+ Assert . Equal ( validValue , contributorId . Value ) ;
11+ }
12+
13+ [ Theory ]
14+ [ InlineData ( 0 ) ]
15+ [ InlineData ( - 1 ) ]
16+ public void ThrowsGivenInvalidValue ( int invalidValue )
17+ {
18+ Assert . Throws < Vogen . ValueObjectValidationException > ( ( ) => ContributorId . From ( invalidValue ) ) ;
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ namespace Clean . Architecture . UnitTests . Core . ContributorAggregate ;
2+
3+ public class ContributorNameFrom
4+ {
5+ [ Fact ]
6+ public void CreatesGivenValidValue ( )
7+ {
8+ string validValue = "ardalis" ;
9+ var contributorName = ContributorName . From ( validValue ) ;
10+ Assert . Equal ( validValue , contributorName . Value ) ;
11+ }
12+
13+ [ Theory ]
14+ [ InlineData ( null ) ]
15+ [ InlineData ( "" ) ]
16+ public void ThrowsGivenInvalidValue ( string ? invalidValue )
17+ {
18+ Assert . Throws < Vogen . ValueObjectValidationException > ( ( ) => ContributorName . From ( invalidValue ! ) ) ;
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments