nspec

Reusing NSpec specifications

白昼怎懂夜的黑 提交于 2020-01-05 09:35:54
问题 I've started with NSpec recently and now I'm not sure how to scale this. What is the best way to reuse specifications ( it["something"] = () => {}; )? Let's say I have an interface IMyService and 2 classes that implement it: Service1 and Service2 . Now I want to write specifications that apply at IMyservice level, and run them against my 2 implementation classes. Maybe I'm missing something here, but I can find a simple way to do this. 回答1: You can use a abstract class to reuse the

How to debug in Visual Studio with NSpec

回眸只為那壹抹淺笑 提交于 2019-12-21 19:45:27
问题 how do I debug in visual studio with NSpec? I've resharper installed I need to step into my test code. 回答1: At least in Visual Studio 2013, the NSpec Test Adapter (by {o} Software) seems to do the trick. Find it in the Extensions gallery. Then just right-click on the test in the Test Explorer and hit Debug. 回答2: Another good option is to just type System.Diagnostics.Debugger.Launch() in the test you want to debug. You'll get a Visual Studio prompt to debug the test. I would also recommend

Can anyone show me some examples of NSpec being used to test controllers (and other aspects of MVC site)?

馋奶兔 提交于 2019-12-08 10:24:57
问题 I'm starting working with NSpec but would love a few pointers on the right way to use it to spec or test my controllers. Basically a few examples would go a very long way. Are there any example projects out there? All help would be appreciated. Richard. 回答1: Why yes! The tests suite that follows is from a reference implementation, there are 4 unique mvc applications that all use NSpec as their test suite. Definitely check them out here. Here is one of the tests. This specification verifies a

How do I set up NCrunch to run nspec tests

本秂侑毒 提交于 2019-12-07 03:02:26
问题 I'm struggling to set up NCrunch to run my nspec tests automatically. On the ncrunch forums it says this functionality has not been implemented yet, but then MattFlo says he prefers using NCrunch, so I'm pretty sure it can be made to work. Help would be greatly appreciated! 回答1: We are working on getting NCrunch fully supported. For now you can use the DebuggerShim (it's a cs file included with NSpec) as a shim to run it via NCrunch. The DebuggerShim is pretty much an NUnit test that runs

How do I set up NCrunch to run nspec tests

醉酒当歌 提交于 2019-12-05 09:11:19
I'm struggling to set up NCrunch to run my nspec tests automatically. On the ncrunch forums it says this functionality has not been implemented yet, but then MattFlo says he prefers using NCrunch, so I'm pretty sure it can be made to work. Help would be greatly appreciated! We are working on getting NCrunch fully supported. For now you can use the DebuggerShim (it's a cs file included with NSpec) as a shim to run it via NCrunch. The DebuggerShim is pretty much an NUnit test that runs NSpec tests. You may want to take a look at specwatchr . Matt likes to use NCruch, but I find that it's to

How to debug in Visual Studio with NSpec

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:55:53
how do I debug in visual studio with NSpec? I've resharper installed I need to step into my test code. At least in Visual Studio 2013, the NSpec Test Adapter (by {o} Software) seems to do the trick. Find it in the Extensions gallery. Then just right-click on the test in the Test Explorer and hit Debug. Another good option is to just type System.Diagnostics.Debugger.Launch() in the test you want to debug. You'll get a Visual Studio prompt to debug the test. I would also recommend taking a look at specwatchr . I use a simple trick that let's me debug NSpec with resharper out of the box. The idea