Skip to content

axle-h/xunit-fixture-mvc-mysql

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages