Samples of end-to-end, in-memory integration tests using ASP.NET Core 2.1 with Entity Framework Core.
Based on this blog post.
Demo project containing end-to-end, in-memory integration tests in ASP.NET Core 2.1
Home Page: https://fullstackmark.com/post/20/painless-integration-testing-with-aspnet-core-web-api
License: MIT License
Samples of end-to-end, in-memory integration tests using ASP.NET Core 2.1 with Entity Framework Core.
Based on this blog post.
I am trying to use this sample for my own project but when running the tests I get this error
System.InvalidOperationException : No method 'public static IWebHostBuilder CreateWebHostBuilder(string[] args)' found on 'AutoGeneratedProgram'. Alternatively, WebApplicationFactory1 can be extended and 'protected virtual IWebHostBuilder CreateWebHostBuilder()' can be overridden to provide your own IWebHostBuilder instance.
The code works perfectly - thank you. However, when upgrading to .NET Core 2.2.0 the SQLite DB cannot be found:
SqliteException: SQLite Error 14: 'unable to open database file'.
Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
In addition to compiling I had to set some specific info in the *.csproj files in order to work around compile issues:
<RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
I also deleted the migrations folder and run the following just to reset the database:
dotnet ef migrations add InitialCreate
dotnet ef database update
The unit tests work - as they are using the in memory DB, but the web site cannot find the players.db file - even though it was created by EF.
Any thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.