Skip to content

Commit

Permalink
Merge pull request #27 from grupadotnet/refactor-tests
Browse files Browse the repository at this point in the history
Refactor test project
  • Loading branch information
Gromate authored Jan 10, 2025
2 parents 4092c76 + bd28fa9 commit b04eac1
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace pimi_connect_api.UnitTests.ControllersTests;

[Collection("TestsWhichUseDatabase_pimi-connect-test")]
public class AttachmentControllerTests : ControllerUnitTestsBase<AttachmentDto>
public class AttachmentControllerTests : ControllerTestsBase<AttachmentDto>
{
private AttachmentController _attachmentController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace pimi_connect_api.UnitTests.Base;

public abstract class ControllerUnitTestsBase<TDtoType> where TDtoType : class
public abstract class ControllerTestsBase<TDtoType> where TDtoType : class
{
#region Properties
protected AppDbContext TestDbContext { get; private set; }
Expand All @@ -19,7 +19,7 @@ public abstract class ControllerUnitTestsBase<TDtoType> where TDtoType : class
protected Guid NotExistingId { get; private set; }
#endregion

protected ControllerUnitTestsBase()
protected ControllerTestsBase()

Check warning on line 22 in pimi-connect-api/pimi-connect-api.Tests/ControllersTests/Base/ControllerTestsBase.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable property 'Configuration' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 22 in pimi-connect-api/pimi-connect-api.Tests/ControllersTests/Base/ControllerTestsBase.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable property 'Settings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 22 in pimi-connect-api/pimi-connect-api.Tests/ControllersTests/Base/ControllerTestsBase.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable property 'ExistingIds' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
SetupConfiguration();
SetupSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace pimi_connect_api.UnitTests.ControllersTests;

[Collection("TestsWhichUseDatabase_pimi-connect-test")]
public class UserControllerTests : ControllerUnitTestsBase<UserDto>
public class UserControllerTests : ControllerTestsBase<UserDto>
{
private UserController _userController;

Check warning on line 10 in pimi-connect-api/pimi-connect-api.Tests/ControllersTests/UserControllerTests.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable field '_userController' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<Folder Include="UnitTests\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion pimi-connect-api/pimi-connect-api.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "pimi-connect-api.API", "pim
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pimi-connect-api.Data", "pimi-connect-api.Data\pimi-connect-api.Data.csproj", "{A8E47DDB-D67E-4B96-86B7-499D7BC1C2A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pimi-connect-api.UnitTests", "pimi-connect-api.UnitTests\pimi-connect-api.UnitTests.csproj", "{AE58D6D6-F050-48A8-B303-EB30933D2208}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pimi-connect-api.Tests", "pimi-connect-api.Tests\pimi-connect-api.Tests.csproj", "{AE58D6D6-F050-48A8-B303-EB30933D2208}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit b04eac1

Please sign in to comment.