I'm trying to mock the static System.IO namespace methods in C#, so I have calls like this:
Mock.SetupStatic<File>();
Mock.Arrange( () => File.AppendText(Arg.AnyString)).DoNothing();
because I want to stop the filesystem from writing anything. When I do so, however, I receive the following error:
'Telerik.JustMock.Expectations.FuncExpectation<System.IO.StreamWriter>' does not contain a definition for 'DoNothing' and no extension method 'DoNothing' accepting a first argument of type 'Telerik.JustMock.Expectations.FuncExpectation<System.IO.StreamWriter>' could be found (are you missing a using directive or an assembly reference?)
In a different test method in the same class using a static class of my own, I am able to make that call without any difficulty.
What am I missing?
Mock.SetupStatic<File>();
Mock.Arrange( () => File.AppendText(Arg.AnyString)).DoNothing();
because I want to stop the filesystem from writing anything. When I do so, however, I receive the following error:
'Telerik.JustMock.Expectations.FuncExpectation<System.IO.StreamWriter>' does not contain a definition for 'DoNothing' and no extension method 'DoNothing' accepting a first argument of type 'Telerik.JustMock.Expectations.FuncExpectation<System.IO.StreamWriter>' could be found (are you missing a using directive or an assembly reference?)
In a different test method in the same class using a static class of my own, I am able to make that call without any difficulty.
What am I missing?