Questions tagged [systemwrapper]

8 questions
4
votes
1 answer

How to mock 'out' parameter?

I have downloaded the latest NSubstitute release, 1.1.0, May 21, 2011. Prior to this release, it seems that NSub did not support out parameters. It appears that some work has been done to provide support through an intermediate release: NSub Google…
IAbstract
  • 19,551
  • 15
  • 98
  • 146
3
votes
1 answer

Ruby C Bindings vs. Ruby Wrapper for System Calls

What are the major differences between the execution of Ruby C bindings vs. Ruby wrapper for system calls? To my question into context, I am looking into incorporating Git version control functionality heavily into a Ruby on Rails application. In…
rudolph9
  • 8,021
  • 9
  • 50
  • 80
1
vote
1 answer

Mocking the Registry - SystemWrapper

I've tried following this as a guide for Mocking the registry: http://www.rhyous.com/2011/11/04/unit-testing-registry-access-with-rhinomocks-and-systemwrapper/ When I try to Mock it, I always get a null return for "reg" in my class when it tries to…
John
  • 6,503
  • 3
  • 37
  • 58
1
vote
1 answer

Using Moq with SystemWrapper To unit testing an Action c# MVC

I'm trying to test an action where I have an InputStream, and I don't really know how to procede. I'm trying with mocking the class and I get notice that we cannot Mock the System.IO because we don't have an abstraction layer. So, after some…
Le-Mr-Ruyk
  • 179
  • 2
  • 17
1
vote
1 answer

Unit Testing using SystemWrapper and Rhino Mocks

I have the method which makes backup of some file: public void MakeBackup(IFileWrap file, string path) { if (path == null) throw new ArgumentNullException(); Console.WriteLine(); string backups =…
Kirill Ludcev
  • 73
  • 2
  • 9
0
votes
1 answer

C# SystemWrapper mock File.ReadAllLines

In a method I would usually do something like this: string[] lines = File.ReadAllLines(filename); To test, I'd like to be able to mock out the file system, and I have heard positive comments about SystemWrapper, so I'd like to use this library. As…
Michael Plautz
  • 3,578
  • 4
  • 27
  • 40
0
votes
2 answers

Mocking File.OpenWrite()

I'm trying to write a unit test that writes to a file it opens with File.OpenWrite(). I'm wrapping File with SystemWrapper's IFileWrap interface. In production, I'm using SimpleInjector to inject an instance of SystemWrapper's FileWrap class, and…
Jeff Dege
  • 11,190
  • 22
  • 96
  • 165
-1
votes
1 answer

Issue with SystemWrapper and Castle Windsor

I have being trying to use SystemWrapper to be able to mock file IO and other standard MS methods that I was writing my own wrappers for. However, I find that Castle Windsor, the IOC I am using, is having issues with it. I am specifically working…
CMason
  • 29
  • 1
  • 5