moq
How to Moq a FtpDataStream
I code a FTP client Application, testing my functions by nunit tool. I try to mock FTP data stream. GetAllCsvFilesFromFTP method call FtpConnect() method, but while testing I want to get a Stream data[详细]
2023-03-31 10:31 分类:问答Issue with Mock repository
I have a service containing the following method, which queries a repository, like so: public IEnumerable<Variable> ListVariables(int instanceId, int instanceVersionId, TypeGroup typeGroup)[详细]
2023-03-31 06:28 分类:问答Nuget Moq 4.0.10827 and InternalsVisibleTo (Again)
I have been trying to get Moq (or rather Castle.Core) to create proxies for my internal types. The following (when added to my project under test), allows things to work:[详细]
2023-03-31 04:28 分类:问答Mock presence of Authorize attribute
I was wondering how you could mock that a controller is decorated with the [Authorize] attribute in MVC3? I am using a custom membership provider. I would like to test that a controller been decorated[详细]
2023-03-30 19:21 分类:问答Does Moq mocking library for .NET 3.5 work with mono?
I\'m trying to use Moq on a Mono / .NET 3.5 Project using MonoDevelop for MacOS X I\'ve tried the sample C# code:[详细]
2023-03-27 17:05 分类:问答Mocking classes that implement IQueryable with Moq
I spent an evening trying to mock an object that implements IQueryable: public interface IRepo<T> : IQueryable<T>[详细]
2023-03-27 16:13 分类:问答Moq: Setup a mocked method to fail on the first call, succeed on the second
What\'s th开发者_开发问答e most succinct way to use Moq to mock a method that will throw an exception the first time it is called, then succeed the second time it is called?I would make use of Callbac[详细]
2023-03-27 15:08 分类:问答Moq Verify not checking if a method was called
Hi I am getting an error and I don\'t understand why [SetUp] public void Setup() { visitService = new Mock<IVisitService>();[详细]
2023-03-27 02:17 分类:问答Mocking System.Data.SqlClient.X classes
We have several places in our code-base where we do something similar to the following: DataTable dt = new DataTable();[详细]
2023-03-26 11:52 分类:问答How do I mock MongoDB objects to test my data models?
I\'m using the following logic (MOQ) to attempt to mock out the MongoDB csharp driver objects: var svr = new Mock<MongoServer>(new MongoServerSettings());[详细]
2023-03-25 16:27 分类:问答