在单元测试(Unit Test)时,如果使用Moq作为隔离框架,并需要模似(Mock) DbContext(Entity Framework Core)下的DbSet<Entity>,本项目给出了解决方案,可以用List<Entity>或Entity[],模拟DbSet<Entity>完成测试操作。.
Info
Version: | 1.0.1 |
Author(s): | 桂素伟 |
Last Update: | Friday, November 3, 2017 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/axzxs2001/MoqEFCoreExtension |
NuGet Url: | https://www.nuget.org/packages/MoqEFCoreExtension |
Install
Install-Package MoqEFCoreExtension
dotnet add package MoqEFCoreExtension
paket add MoqEFCoreExtension
MoqEFCoreExtension Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.EntityFrameworkCore(>= 2.0.0)
- Moq(>= 4.7.142)
Tags