4

Typemock can do this but it is $799USD and that is a lot to pay for two features.

Please no conversations about avoiding using static and sealed things or encapsulating them. When using a large 3rd party API it is not possible and/or practical.

Thanks

Simon
  • 33,714
  • 21
  • 133
  • 202
  • Your 3rd party framework does not seem to consider testing. There are still companies which do not know what an interface is good for ... – Stefan Steinegger Nov 03 '09 at 10:52
  • You are correct stefan. Their response to testing is "create a database with you test data and then run your tests" – Simon Nov 03 '09 at 21:10

2 Answers2

1

The only thing I could find was: http://research.microsoft.com/en-us/projects/stubs/

I admit to having not used it, but I thought yourself and others may find the link useful.

Lee
  • 878
  • 7
  • 16
1

Not really, but you can use Moq Moq Download or Rhino Mocks Rhino Mocks Download to wrap the static method and call in a virtual instance method in another class

Mocking Static methods using Rhino.Mocks

Community
  • 1
  • 1
Sara
  • 612
  • 5
  • 21
  • i regularly use this for the occasional case but the API I am dealing with at the moment has a very large surface area and it would be a pain to take this aproach. Thanks anyway. – Simon Nov 01 '09 at 21:29