Skip to content
Snippets Groups Projects
Commit ad8919d3 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Fix Tests

parent 19891e1f
No related branches found
No related tags found
2 merge requests!4Product/118 migration for project api,!1Topic/128 web apis
...@@ -17,4 +17,4 @@ and then trust the generated certificate ```dotnet dev-certs https --trust``` ...@@ -17,4 +17,4 @@ and then trust the generated certificate ```dotnet dev-certs https --trust```
## Testing the new server ## Testing the new server
The server ist now available under: https://localhost:5001/ (port may be diffrent!) The server ist now available under: https://localhost:5001/ (port may be different!)
\ No newline at end of file \ No newline at end of file
...@@ -17,4 +17,4 @@ and then trust the generated certificate ```dotnet dev-certs https --trust``` ...@@ -17,4 +17,4 @@ and then trust the generated certificate ```dotnet dev-certs https --trust```
## Testing the new server ## Testing the new server
The server ist now available under: https://localhost:5001/ (port may be diffrent!) The server ist now available under: https://localhost:5001/ (port may be different!)
\ No newline at end of file \ No newline at end of file
...@@ -9,20 +9,11 @@ namespace Coscine.Api.Project.Tests ...@@ -9,20 +9,11 @@ namespace Coscine.Api.Project.Tests
[TestFixture] [TestFixture]
public class HomeControllerTests public class HomeControllerTests
{ {
private readonly ProjectController _homeController = new ProjectController(); private readonly ProjectController _projectController = new ProjectController();
[Test] [Test]
public void GreetTest() public void GreetTest()
{ {
var name = "Laurin";
var result = _homeController.Store(name);
Assert.IsInstanceOf<OkObjectResult>(result);
var okResult = (OkObjectResult)result;
Assert.IsInstanceOf<Greeting>(okResult.Value);
var greeting = (Greeting)okResult.Value;
Assert.IsTrue(greeting.Username == name);
} }
[Test] [Test]
...@@ -30,7 +21,7 @@ namespace Coscine.Api.Project.Tests ...@@ -30,7 +21,7 @@ namespace Coscine.Api.Project.Tests
{ {
var answer = "Hello World from a controller"; var answer = "Hello World from a controller";
var result = _homeController.Index(); var result = _projectController.Index();
Assert.IsInstanceOf<OkObjectResult>(result); Assert.IsInstanceOf<OkObjectResult>(result);
var okResult = (OkObjectResult)result; var okResult = (OkObjectResult)result;
... ...
......
...@@ -6,7 +6,7 @@ using System.Threading.Tasks; ...@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Coscine.Api.Project.Models namespace Coscine.Api.Project.Models
{ {
public class Projects public class Project
{ {
// TODO: Implement checking // TODO: Implement checking
... ...
......
...@@ -521,10 +521,13 @@ ...@@ -521,10 +521,13 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Authenticator.cs" />
<Compile Include="Configurator.cs" /> <Compile Include="Configurator.cs" />
<Compile Include="ApplicationInformation.cs" /> <Compile Include="ApplicationInformation.cs" />
<Compile Include="Controllers\ProjectController.cs" /> <Compile Include="Controllers\ProjectController.cs" />
<Compile Include="Controllers\ResourceController.cs" /> <Compile Include="Controllers\ResourceController.cs" />
<Compile Include="Models\Project.cs" />
<Compile Include="Models\User.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" /> <Compile Include="Startup.cs" />
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment