FIxing issues
This commit is contained in:
@@ -33,7 +33,7 @@ public class RoleController_Tests
|
|||||||
{
|
{
|
||||||
IConfiguration configuration = TestUtils.CreateConfiguration();
|
IConfiguration configuration = TestUtils.CreateConfiguration();
|
||||||
_roleServiceMock = new Mock<IRoleService>();
|
_roleServiceMock = new Mock<IRoleService>();
|
||||||
_roleController = new RoleController(configuration, _roleServiceMock?.Object);
|
_roleController = new RoleController(configuration, _roleServiceMock.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
protected readonly IConfiguration _configuration;
|
protected readonly IConfiguration _configuration;
|
||||||
protected readonly AppSettings _appSettings;
|
protected readonly AppSettings _appSettings;
|
||||||
protected readonly string _requestNotWellFormed = "Request is not well formed";
|
protected readonly string _requestNotWellFormed = "Request is not well formed";
|
||||||
|
protected readonly string _somethingWentWrong = "Something went wrong";
|
||||||
|
|
||||||
protected BaseController(
|
protected BaseController(
|
||||||
IConfiguration configuration
|
IConfiguration configuration
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
@@ -105,7 +105,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
@@ -146,7 +146,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(role.IsNotEditable)
|
if (role.IsNotEditable)
|
||||||
{
|
{
|
||||||
return BadRequest("This role is not editable");
|
return BadRequest("This role is not editable");
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
@@ -212,7 +212,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
@@ -118,7 +118,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
var message = "Something went wrong";
|
var message = this._somethingWentWrong;
|
||||||
if (!String.IsNullOrEmpty(exception.Message))
|
if (!String.IsNullOrEmpty(exception.Message))
|
||||||
{
|
{
|
||||||
message += $". {exception.Message}";
|
message += $". {exception.Message}";
|
||||||
|
|||||||
Reference in New Issue
Block a user