Skip to content

Commit

Permalink
Assignment.List test
Browse files Browse the repository at this point in the history
  • Loading branch information
subchannel13 committed Apr 26, 2024
1 parent 43d2902 commit 9292fd2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
6 changes: 6 additions & 0 deletions api.integrationTests/ApiWappFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Microsoft.AspNetCore.Mvc.Testing;

namespace api.integrationTests;

internal class ApiWappFactory : WebApplicationFactory<Program>
{}
20 changes: 20 additions & 0 deletions api.integrationTests/AssignmentTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Net.Http.Json;

namespace api.integrationTests;

public class AssignmentTest
{
[Fact]
public async void List()
{
var application = new ApiWappFactory();
var client = application.CreateClient();

var response = await client.GetAsync("Assignment/List");
response.EnsureSuccessStatusCode();

var responseData = await response.Content.ReadFromJsonAsync<Assignment[]>();
Assert.NotNull(responseData);
Assert.Single(responseData);
}
}
10 changes: 0 additions & 10 deletions api.integrationTests/UnitTest1.cs

This file was deleted.

0 comments on commit 9292fd2

Please sign in to comment.