How can I do an in-memory SQL Server for integration testing?

user3093582

I want to be able to create a database and tables the same way Amazon's DynamoDb client does it but with Sql Server. Is that possible?

I'm using .net Core and this is for integration tests. Figured I can throw in the code in the fixture.

Anyone have any ideas?

David Browne - Microsoft

EF Core Migrations:

"The migrations feature in EF Core provides a way to incrementally update the database schema to keep it in sync with the application's data model while preserving existing data in the database."

Create and Drop APIs:

"The EnsureCreated and EnsureDeleted methods provide a lightweight alternative to Migrations for managing the database schema. These methods are useful in scenarios when the data is transient and can be dropped when the schema changes. For example during prototyping, in tests, or for local caches."

to create your tables at runtime.

And then use one of the Data Seeding techniques:

Data seeding is the process of populating a database with an initial set of data. There are several ways this can be accomplished in EF Core:

  • Model seed data
  • Manual migration customization
  • Custom initialization logic

to populate them with known data.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I do test setup using the testing package in Go

Integration testing with in-memory IdentityServer

How can I do an UPDATE statement with JOIN in SQL Server?

How can I truncate a datetime in SQL Server?

How can I insert audio into SQL Server

How to do integration testing in Clojure?

How can I import the package from the SQL Server Integration Services catalog?

How do you force SQL Server to release memory?

SQL Server Database Unit Testing and Continuous Integration

How can I disable multithreading in SQL Server?

How to do integration testing in Flutter?

How can I prevent a React state update on an unmounted component in my integration testing?

How to do Ember integration testing for route transitions?

How Can I perform Integration Testing against Oracle UCM with consistent data?

How do I check Memory leakage in solaris server?

How can I do automated testing in the WCF web service?

How can I measure hardware specs for Continuous Integration server (Jenkins)?

How do I handle elasticsearch's index timing when doing integration testing with mocha

In ServiceStack, how can I do integration testing with multiple endpoints?

How can I do unit testing for retrofit callbacks?

SQL Server Integration Services - Out of memory exception

How can I write this SQL Server query?

How can I reshape a table in SQL Server?

How can I solve this query in sql server?

How can I print this in sql server?

C# - How can I do MS SQL Server Connection?

How can i do cumulative total in SQL Server?

How can I do this in Flutter Testing

How can I do "double-aggregation" in T-SQL / SQL Server?

TOP Ranking

HotTag

Archive