Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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();

About

MVC functional tests with a fixture pattern for a MySql database on EF Core

Resources

Releases

No releases published

Packages

No packages published

Languages