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