Sprint 8 #43

Merged
csimonapastore merged 20 commits from sprints/8 into main 2025-06-21 01:11:03 +02:00
4 changed files with 50 additions and 50 deletions
Showing only changes of commit 1fc8e6cc1c - Show all commits

View File

@@ -61,7 +61,7 @@ public class AuthController_Tests
ObjectResult response = (ObjectResult)(await controller.AuthenticateAsync(request));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -98,7 +98,7 @@ public class AuthController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -140,7 +140,7 @@ public class AuthController_Tests
if (response != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status404NotFound);
Assert.AreEqual(StatusCodes.Status404NotFound, response.StatusCode);
}
else
{
@@ -168,7 +168,7 @@ public class AuthController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -207,13 +207,13 @@ public class AuthController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{

View File

@@ -70,7 +70,7 @@ public class RoleController_Tests
ObjectResult response = (ObjectResult)(await _roleController.GetRoleByGuidAsync(guid));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -105,7 +105,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -141,7 +141,7 @@ public class RoleController_Tests
if (response != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status404NotFound);
Assert.AreEqual(StatusCodes.Status404NotFound, response.StatusCode);
}
else
{
@@ -167,7 +167,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -202,13 +202,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{
@@ -255,7 +255,7 @@ public class RoleController_Tests
ObjectResult response = (ObjectResult)(await _roleController.CreateRoleAsync(request));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -297,13 +297,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
Assert.IsTrue(result.Message == "Invalid name");
Assert.AreEqual("Invalid name", result.Message );
}
else
{
@@ -341,7 +341,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -391,7 +391,7 @@ public class RoleController_Tests
ObjectResult response = (ObjectResult)(await _roleController.CreateRoleAsync(request));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -441,7 +441,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -494,13 +494,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{
@@ -531,7 +531,7 @@ public class RoleController_Tests
ObjectResult response = (ObjectResult)(await _roleController.DeleteRoleByGuidAsync(guid));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
}
else
{
@@ -555,7 +555,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -591,7 +591,7 @@ public class RoleController_Tests
if (response != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status404NotFound);
Assert.AreEqual(StatusCodes.Status404NotFound, response.StatusCode);
}
else
{
@@ -617,7 +617,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -652,13 +652,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{
@@ -708,7 +708,7 @@ public class RoleController_Tests
ObjectResult response = (ObjectResult)(await _roleController.UpdateRoleAsync(request, role.Guid));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -752,7 +752,7 @@ public class RoleController_Tests
if (response != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status404NotFound);
Assert.AreEqual(StatusCodes.Status404NotFound, response.StatusCode);
}
else
{
@@ -786,13 +786,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
Assert.IsTrue(result.Message == "Invalid name");
Assert.AreEqual("Invalid name", result.Message );
}
else
{
@@ -832,7 +832,7 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -874,7 +874,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -922,7 +922,7 @@ public class RoleController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -976,13 +976,13 @@ public class RoleController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{

View File

@@ -80,7 +80,7 @@ public class UserController_Tests
ObjectResult response = (ObjectResult)(await _userController.GetUserByGuidAsync(guid));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -115,7 +115,7 @@ public class UserController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -151,7 +151,7 @@ public class UserController_Tests
if (response != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status404NotFound);
Assert.AreEqual(StatusCodes.Status404NotFound, response.StatusCode);
}
else
{
@@ -177,7 +177,7 @@ public class UserController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -212,13 +212,13 @@ public class UserController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{
@@ -265,7 +265,7 @@ public class UserController_Tests
ObjectResult response = (ObjectResult)(await _userController.CreateUserAsync(request));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status200OK);
Assert.AreEqual(StatusCodes.Status200OK, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -311,7 +311,7 @@ public class UserController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -362,7 +362,7 @@ public class UserController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -407,7 +407,7 @@ public class UserController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -462,7 +462,7 @@ public class UserController_Tests
ObjectResult response = (ObjectResult)(await _userController.CreateUserAsync(request));
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
@@ -515,7 +515,7 @@ public class UserController_Tests
// if (response != null && response.Value != null)
// {
// Assert.IsTrue(response.StatusCode == StatusCodes.Status400BadRequest);
// Assert.AreEqual(StatusCodes.Status400BadRequest, response.StatusCode);
// var result = (BaseResponse<object>)response.Value;
// if (result != null)
@@ -577,13 +577,13 @@ public class UserController_Tests
if (response != null && response.Value != null)
{
Assert.IsTrue(response.StatusCode == StatusCodes.Status500InternalServerError);
Assert.AreEqual(StatusCodes.Status500InternalServerError, response.StatusCode);
var result = (BaseResponse<object>)response.Value;
if (result != null)
{
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
Assert.IsTrue(result.Message == "Something went wrong. Unexpected error");
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
}
else
{

View File

@@ -71,7 +71,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
{
try
{
if (await this._userService.CheckIfEmailIsValid(request.Data.Email))
if (await this._userService.CheckIfEmailIsValid(request!.Data!.Email))
{
var role = await this._roleService.GetRoleForUser(request.Data.RoleGuid);
if (role == null)