Discussions

Ask a Question

Any advice for use with Knockout?

I'm on a project now that uses Knockout on the front-end, but I'm hopelessly addicted to SpecsFor.Mvc. I imagine that if the on-page controls follow the same naming convention as MVC would have, then SpecsFor would still be able to find them and use them. As I understand it from the MvcTemplates package, the magic is in wrapping a span around the controls and naming it after the property on the viewmodel. Is this correct? Are there any examples of workable patterns for integrating with Knockout? How about other front-end technologies like Angular?
ANSWERED

BeforeEachSpec?

There is an AfterEachSpec, but no matching BeforeEachSpec. Given and When seem to run once per fixture if I'm not mistaken, or at least they appear to be working that way. I have a specific mock that I want to set up differently for one test. Yes, I know that's technically a new context, and I should build a new fixture, but that's would be so heavy in this case that I opted for a simpler text fixture with the individual tests taking some responsibility for tweaking the mocks. Don't you judge me... stop looking at me like that! I am NOT doing it wrong! Okay, fine, I'm doing it wrong. Anyway, I'm seeing the mock behavior bleed over from one test to another depending on their execution order. What I'd like is to set up the 99% behavior in a BeforeEachSpec, and tweak it in just the one test that deviates.
ANSWERED

ShouldLookLike for a List

How can I assert a list, something like below: myResult.ShouldLookLike(() => new List<MyObject>(){ new MyObject(){ //resultId is Guid, so this should be ignore ObjectName = "result name 1", ObjectValue = "object value 1" }, new MyObject(){ //resultId is Guid, so this should be ignore ObjectName = "result name 2", ObjectValue = "object value 2" } }
ANSWERED

WCF

Any issues/recommendations/suggestions with using SpecsFor with WCF? I'm using vanilla nunit however i'm really liking SpecsFor and would like to migrate those tests into this framework. Thanks Sean
ANSWERED

Theory

How does this library interact with Theories. I'd like to have multiple datapoints for my tests.
ANSWERED

Telerik JustMock

Do you see any issues with using Specs for and Telerik's JustMock mocking library? We have a dependency on it for Fakes of legacy code.

Windows Authentication not working

Hi, how do you tell your framework to use windows authentication with the IIS Express host. <authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization> My tests are failing, since the page returns Error message 401.2.: Unauthorized: Logon failed due to server configuration. With the authorization set to None, allow all users, it works as expected. Thanks, Stevo
ANSWERED

HTTP Headers

Hello Is there a way to detect the header response, when the form is submitted? For example SUT.FindFormFor<RegistrationViewModel>() .Field(x => x.Email) .SetValueTo("[email protected]") .Field(x => x.Password) .SetValueTo("12345") .Submit(); At this point, if the response is HTTP 500, the testing goes on. "When" does not fail. Is there a way to assert that the response must be HTTP 200?