MVC functional tests with a fixture pattern for a MySql database on EF Core
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src/Xunit.Fixture.Mvc.MySql
.gitattributes
.gitignore
README.md
appveyor.yml
xunit-fixture-mvc-mysql.sln

README.md

Build status NuGet

xunit-fixture-mvc-mysql

MVC functional tests with a fixture pattern built on top of xunit-fixture-mvc and extended for a MySql database on EF Core.

For example:

[Fact]
public Task When_creating_breakfast_item() =>
    new MvcFunctionalTestFixture<Startup>(_output)
        .HavingMySqlDatabase<BreakfastContext>()
        .WhenCreating("BreakfastItem", out CreateOrUpdateBreakfastItemRequest request)
        .ShouldReturnSuccessfulStatus()
        .JsonResultShould<BreakfastItem>(r => r.Id.Should().Be(1),
                                         r => r.Name.Should().Be(request.Name),
                                         r => r.Rating.Should().Be(request.Rating))
        .ShouldExistInDatabase<BreakfastContext, BreakfastItem>(1,
                                        x => x.Id.Should().Be(1),
                                        x => existing.Name.Should().Be(request.Name),
                                        x => x.Rating.Should().Be(request.Rating))
        .RunAsync();