Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
NSubstitute 不匹配 Linq 表达式
我正在实现一个存储库模式查询类并使用 NSubstitute 进行测试 存储库接口 public interface IMyRepository IQueryable
LINQ
repositorypattern
linqexpressions
nsubstitute
在模拟 Excel.worksheet 时如何避免使用动态?
我正在尝试使用 NSubstitute 或其他模拟框架和 MSTest Visual Studio 2010 模拟 Excel 电子表格 我不确定是否有比这更好的方法 而且这对于测试来说不太有效 这是一个示例 这是目前的所有原型代码 并且不
c
Excel
mocking
vsto
nsubstitute
使用 NSubstitute 模拟表达式
我有一个包含以下方法签名的接口 TResult GetValue
c
NET
moq
nsubstitute
如何使用 Autofixture 创建和填充我的模拟类?
目前 我正在使用 EF6 在 UnitOfWork 内实现我的存储库 我还创建了一个内存中模拟实现 MockUnitOfWork 和 MockRepository 以便我可以在单元测试中使用它们 但是我现在必须处理对象的繁琐设置 这不就是
c
autofixture
nsubstitute
NSubstitute DbSet / IQueryable
因此 EntityFramework 6 比以前的版本具有更好的可测试性 还有一些很好的例子 http msdn microsoft com en us data dn314429 queryTest在互联网上寻找像 Moq 这样的框架 但
c
EntityFramework
dbcontext
nsubstitute
dbset
将 NSubstitute 导入 Unity 项目
我正在尝试在我的 Unity 项目 Unity 版本 2019 2 2f1 中使用 NSubstitute 无论如何导入它 我的 IDE 包括 Visual Studio 和 JetBrains Rider 在尝试时都会出错using NS
c
unittesting
unitygameengine
nsubstitute
二维对象数组返回类型 - NSubstitute
我遇到强制转换异常 System InvalidCastException 无法将类型 System Object 的对象强制转换为类型 System Object 在 Castle Proxies ITestProxy Get2DArra
c
NET
TDD
nunit
nsubstitute
使用 DbSet
和 IQueryable
以及 NSubstitute 操作对象会返回错误
我想用N替补 http nsubstitute github io 通过模拟对 Entity Framework 6 x 进行单元测试DbSet http msdn microsoft com en us library gg696460
c
EntityFramework
unittesting
nsubstitute
dbset
Ninject:使用 NSubstitute 自动模拟?
任何人都可以帮忙 我在使用 Ninject 和 NSubstitute 之间可用的自动模拟时遇到问题 实际上该包是一个名为 ninject 的打包包Ninject MockingKernel NSubstitute这应该允许我使用 Ninj
c
mocking
ninject
nsubstitute
automocking
如何端到端测试这个 .net core 控制台应用程序?
我有一个 Net Core 2 0 控制台应用程序 main 方法是这样的 public static async Task Main create host builder var hostBuilder new HostBuilder
c
NetCore
consoleapplication
xunit
nsubstitute
如何使用 NSubstitute 模拟 DbContext,然后添加/删除数据
我需要模拟 EFDbContext I use 这里的方法 https stackoverflow com a 21075569 3959480而且效果很好 mock a DbSet var mockDbSet Substitute For
c
EntityFramework
dbcontext
nsubstitute
dbset
检查异步方法的 Received() 调用
当我运行以下代码时 Test public async Task Can Test Update var response await controller UpdateAsync Guid NewGuid response Valid S
c
Asynchronous
asyncawait
nsubstitute
NSubstitute ILogger .NET Core
我正在尝试围绕异常处理编写单元测试 以便可以验证我的记录器是否正确记录了异常 我使用 NSubstitute 作为模拟框架Microsoft Extensions Logging ILogger我必须遵循我的测试 Fact public v
c
NET
unittesting
NetCore
nsubstitute
NSubstitute - 检查传递给方法的参数
我们目前正在从 RhinoMocks 迁移到 NSubstitute 我有一个接受类型对象的方法DatabaseParams 该类具有以下结构 简化 public class DatabaseParams public string Sto
c
mocking
nsubstitute
在带有输出参数的 NSubstitute 模拟方法中返回不同的值
给出一种模拟方法 public bool TryReceive out T message TimeSpan millisecondsToWait 我希望在前两次调用中设置不同的消息 然后返回 真的 后续调用将返回 false 我尝试了一些
c
unittesting
nsubstitute
如何在 xunit/autofixture 中组合 PropertyData 和 AutoNSubstituteData 属性?
我正在使用 AutoNSubstituteData 属性 发布在这里 AutoFixture xUnit net 和自动模拟 我想将其与 PropertyData 来自 xunit 扩展的属性 这是我的测试 public static IE
unittesting
mocking
xunitnet
autofixture
nsubstitute
使用 NSubstitute 模拟通用方法
我有一个带有许多通用方法的接口 这些方法根据传入的数据类型执行操作 如何使用 NSubstitute 模拟它 目前 我不得不使用具体的类而不是模拟 因为我无法处理调用该方法的所有可能类型 public interface IInstance
c
NET
nsubstitute
ncrunch