Skip to content

TheTrigger/F2.Testing

Repository files navigation

F2.Testing

Codacy Badge

using F2.Testing;
using Xunit;

namespace F2.Testing.Tests
{
    /// <summary>
    /// Basic configuration
    /// </summary>
    public class DemoTests : IClassFixture<ServerFixture<Startup>>
    {
        private readonly ServerFixture<Startup> _testFixure;
        private readonly WeatherForecastController _controller;

        public DemoTests(ServerFixture<Startup> testFixture)
        {
            _testFixure = testFixture;
            _controller = _testFixure.GetService<WeatherForecastController>();
        }

        [Fact]
        public async Task IsGetWorking()
        {
            var results = await _testFixure.GetAsync<IEnumerable<WeatherForecast>>("WeatherForecast");
            Assert.NotEmpty(results);
        }
    }
}

Refs

About

ASP.NET Core test helper

Topics

Resources

Stars

Watchers

Forks

Languages