File tree 2 files changed +5
-4
lines changed
Reverse-Analytics/Tests/ReverseAnalytics.Tests.Unit
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
namespace ReverseAnalytics . Tests . Unit . Architecture ;
2
2
3
- public class ConstructorsFixture
3
+ public class ConstructorsFixture : ArchitectureTestsBase
4
4
{
5
5
[ Fact ]
6
6
public void ConstructorsOfAllControllers_ShouldThrowArgumentNullException_WhenAnyParameterIsNull ( )
7
7
{
8
8
// Arrange
9
- var constructors = typeof ( ProductCategoryController ) . Assembly
9
+ var constructors = Types . InAssembly ( DomainAssembly )
10
10
. GetTypes ( )
11
11
. Where ( t => t . Namespace is not null && t . Namespace . Contains ( "Controllers" ) )
12
+ . Where ( t => t . IsAssignableTo ( typeof ( ControllerBase ) ) )
12
13
. SelectMany ( t => t . GetConstructors ( ) )
13
- . Where ( t => t . GetParameters ( ) . Length > 0 )
14
+ . Where ( c => c . GetParameters ( ) . Length > 0 )
14
15
. ToList ( ) ;
15
16
16
17
// Act & Assert
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public async Task GetCategoriesAsync_ShouldReturnAllCategories_WhenCalled()
42
42
43
43
// Assert
44
44
okResult . Should ( ) . NotBeNull ( ) ;
45
- okResult ! . StatusCode . Should ( ) . Be ( ( ( int ) HttpStatusCode . OK ) ) ;
45
+ okResult ! . StatusCode . Should ( ) . Be ( ( int ) HttpStatusCode . OK ) ;
46
46
okResult ! . Value . Should ( ) . BeAssignableTo < IEnumerable < ProductCategoryDto > > ( ) ;
47
47
okResult ! . Value . Should ( ) . BeEquivalentTo ( paginatedCategories ) ;
48
48
}
You can’t perform that action at this time.
0 commit comments