Commit c8566218 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Enhance Test with GetId

parent 0477314e
...@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Routing; ...@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Coscine.Api.Project.ReturnObjects;
namespace Coscine.Api.Project.Tests namespace Coscine.Api.Project.Tests
{ {
...@@ -126,6 +127,19 @@ namespace Coscine.Api.Project.Tests ...@@ -126,6 +127,19 @@ namespace Coscine.Api.Project.Tests
{ {
var actionResult = _projectController.Index(); var actionResult = _projectController.Index();
Assert.IsTrue(actionResult.GetType() == typeof(OkObjectResult)); Assert.IsTrue(actionResult.GetType() == typeof(OkObjectResult));
actionResult = _projectController.Get(projects[0].Id.ToString());
Assert.IsTrue(actionResult.GetType() == typeof(OkObjectResult));
OkObjectResult okObjectResult = (OkObjectResult) actionResult;
Assert.IsTrue(okObjectResult.Value.GetType() == typeof(ProjectObject));
ProjectObject projectObject = (ProjectObject) okObjectResult.Value;
Assert.IsTrue(projectObject.Id == projects[0].Id);
Assert.IsTrue(projectObject.Description == projects[0].Description);
Assert.IsTrue(projectObject.DisplayName == projects[0].DisplayName);
Assert.IsTrue(projectObject.Organization == projects[0].Organization);
} }
[Test] [Test]
......
...@@ -43,7 +43,7 @@ namespace Coscine.Api.Project ...@@ -43,7 +43,7 @@ namespace Coscine.Api.Project
{ {
_jwtSecurityTokenHandler.ValidateToken(token, tokenValidationParameters, out SecurityToken securityToken); _jwtSecurityTokenHandler.ValidateToken(token, tokenValidationParameters, out SecurityToken securityToken);
} }
catch(Exception e) catch (Exception)
{ {
return false; return false;
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System.Reflection; using System.Reflection;
[assembly: AssemblyTitle("api-demo")] [assembly: AssemblyTitle("Project")]
[assembly: AssemblyCompany("RWTH Aachen University IT Center")] [assembly: AssemblyCompany("RWTH Aachen University IT Center")]
[assembly: AssemblyProduct("api-demo")] [assembly: AssemblyProduct("Project")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0.0")]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment