Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
Project
Commits
c8566218
Commit
c8566218
authored
Jul 05, 2019
by
Benedikt Heinrichs
Browse files
Enhance Test with GetId
parent
0477314e
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Project.Tests/ProjectControllerTests.cs
View file @
c8566218
...
...
@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Routing;
using
Microsoft.AspNetCore.Mvc.Infrastructure
;
using
Microsoft.AspNetCore.Mvc.Abstractions
;
using
Microsoft.AspNetCore.Mvc.Controllers
;
using
Coscine.Api.Project.ReturnObjects
;
namespace
Coscine.Api.Project.Tests
{
...
...
@@ -126,6 +127,19 @@ namespace Coscine.Api.Project.Tests
{
var
actionResult
=
_projectController
.
Index
();
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
]
...
...
src/Project/JWTHandler.cs
View file @
c8566218
...
...
@@ -43,7 +43,7 @@ namespace Coscine.Api.Project
{
_jwtSecurityTokenHandler
.
ValidateToken
(
token
,
tokenValidationParameters
,
out
SecurityToken
securityToken
);
}
catch
(
Exception
e
)
catch
(
Exception
)
{
return
false
;
}
...
...
src/Project/Properties/AssemblyInfo.cs
View file @
c8566218
...
...
@@ -5,9 +5,9 @@
//------------------------------------------------------------------------------
using
System.Reflection
;
[
assembly
:
AssemblyTitle
(
"
api-demo
"
)]
[
assembly
:
AssemblyTitle
(
"
Project
"
)]
[
assembly
:
AssemblyCompany
(
"RWTH Aachen University IT Center"
)]
[
assembly
:
AssemblyProduct
(
"
api-demo
"
)]
[
assembly
:
AssemblyProduct
(
"
Project
"
)]
[
assembly
:
AssemblyVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyInformationalVersion
(
"1.0.0.0"
)]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment