Fixing sonarcloud issues
This commit is contained in:
@@ -66,7 +66,7 @@ public class AuthController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(AuthenticatedUser));
|
||||
}
|
||||
else
|
||||
@@ -103,7 +103,7 @@ public class AuthController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -173,7 +173,7 @@ public class AuthController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -212,8 +212,8 @@ public class AuthController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(RoleDto));
|
||||
}
|
||||
else
|
||||
@@ -110,7 +110,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -172,7 +172,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -207,8 +207,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -260,7 +260,7 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(RoleDto));
|
||||
}
|
||||
else
|
||||
@@ -302,8 +302,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.AreEqual("Invalid name", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.AreEqual("Invalid name", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -346,7 +346,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -396,8 +396,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.IsTrue(result.Message == "Not created");
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.AreEqual("Not created", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -446,7 +446,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -499,8 +499,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -560,7 +560,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -622,7 +622,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -657,8 +657,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -713,7 +713,7 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(RoleDto));
|
||||
}
|
||||
else
|
||||
@@ -791,8 +791,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.AreEqual("Invalid name", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.AreEqual("Invalid name", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -837,7 +837,7 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.IsTrue(result.Message == "This role is not editable");
|
||||
}
|
||||
else
|
||||
@@ -879,7 +879,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -927,7 +927,7 @@ public class RoleController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -981,8 +981,8 @@ public class RoleController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(UserDto));
|
||||
}
|
||||
else
|
||||
@@ -120,7 +120,7 @@ public class UserController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -182,7 +182,7 @@ public class UserController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -217,8 +217,8 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -270,7 +270,7 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status200OK);
|
||||
Assert.AreEqual(StatusCodes.Status200OK, result.Status);
|
||||
Assert.IsInstanceOfType(result.Data, typeof(UserDto));
|
||||
}
|
||||
else
|
||||
@@ -316,7 +316,7 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.IsTrue(result.Message == "Invalid email");
|
||||
}
|
||||
else
|
||||
@@ -367,7 +367,7 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.IsTrue(result.Message == "Role not found");
|
||||
}
|
||||
else
|
||||
@@ -412,7 +412,7 @@ public class UserController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
// else
|
||||
@@ -467,8 +467,8 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
Assert.IsTrue(result.Message == "Not created");
|
||||
Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
Assert.AreEqual("Not created", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -520,7 +520,7 @@ public class UserController_Tests
|
||||
// var result = (BaseResponse<object>)response.Value;
|
||||
// if (result != null)
|
||||
// {
|
||||
// Assert.IsTrue(result.Status == StatusCodes.Status400BadRequest);
|
||||
// Assert.AreEqual(StatusCodes.Status400BadRequest, result.Status);
|
||||
// Console.WriteLine(JsonConvert.SerializeObject(result));
|
||||
// Assert.IsTrue(result.Message == "Request is not well formed");
|
||||
// }
|
||||
@@ -582,8 +582,8 @@ public class UserController_Tests
|
||||
var result = (BaseResponse<object>)response.Value;
|
||||
if (result != null)
|
||||
{
|
||||
Assert.IsTrue(result.Status == StatusCodes.Status500InternalServerError);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message );
|
||||
Assert.AreEqual(StatusCodes.Status500InternalServerError, result.Status);
|
||||
Assert.AreEqual("Something went wrong. Unexpected error", result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user