Skip to content

Instantly share code, notes, and snippets.

@gnschenker
Created December 30, 2019 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnschenker/42faed181689bfbd227c6262b9ac642d to your computer and use it in GitHub Desktop.
Save gnschenker/42faed181689bfbd227c6262b9ac642d to your computer and use it in GitHub Desktop.
First integration test with base class
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using api;
using Xunit;
namespace tests
{
public class GlossaryControllerTests : ControllerTestsBase
{
public GlossaryControllerTests(WebApiTesterFactory factory): base(factory)
{}
[Fact]
public async Task should_return_list_of_glossary_items_without_need_for_token()
{
var response = await client.GetAsync("glossary");
var json = await response.Content.ReadAsStringAsync();
var data = JsonConvert.DeserializeObject<IEnumerable<GlossaryItem>>(json);
Assert.True(data.Count() > 0);
Assert.Equal("AccessToken", data.First().Term);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment