Search code examples
c#unit-testingbddnspec

Does Nspec have something like Rspec's should_receive?


I am writing an Nspec to test some file manipulation. I want to be able to intercept the call just before renaming the file, and I thought something similar to Rspec's should_receive should do. However I can't find anything like that in the Nspec documentations. Is there a equivalent in Nspec?


Solution

  • The short answer is No.

    Nspec is a BDD testing framework without any Mocking/Stubbing capability. If you want to use something like should_receive in rspec you need to use one of the many mocking frameworks in .net.

    Some options: