SpecsFor

{"id":"54471fc9e12a270800028adc","name":"SpecsFor","subdomain":"specsfor","versions":[{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"_id":"54471fc9e12a270800028adf","releaseDate":"2014-10-22T03:08:57.750Z"}],"current_version":{"version_clean":"1.0.0","version":"1.0"},"oauth":{"enabled":false},"api":{"name":"","url":"","contenttype":"form","auth":"","explorer":true,"proxyEnabled":true,"jwt":false,"authextra":[],"headers":[],"object_definitions":[]},"apiAlt":[],"plan_details":{"name":"Developer Hub","is_active":true,"cost":59,"versions":10000,"custom_domain":true,"custom_pages":true,"whitelabel":false,"errors":false,"password":true,"landing_page":true,"stylesheet":true,"javascript":false,"html":true,"extra_html":false,"admins":true},"intercom":"","intercom_secure_emailonly":false,"flags":{"allow_hub2":false,"hub2":false,"migrationRun":false,"oauth":false,"swagger":false,"correctnewlines":false,"speedyRender":false,"allowXFrame":false,"jwt":false,"hideGoogleAnalytics":false,"stripe":false,"disableDiscuss":false,"autoSslGeneration":true,"newApiExplorer":false,"newSearch":true,"useReactApp":false},"asset_base_url":""}
  • Documentation
  • Support
    PopularNewestOpen

    General


    RowTests?

    Are there any examples of using SpecsFor with NUnit's RowTests? (Now called TestCase, I believe) I'd like to replace some SpecFlow (ewww) tests with SpecsFor, but they're making heavy use of the table inputs. The modern NUnit equivalent seems to be the TestCase attribute, but where would it go? It's normally used in place of the [Test] attribute, but the parameters really should be going to the When method. I could just ditch the When, use TestCase and be done with it, but I guess I'm looking for the "yup, that's how you do it" here.

    Posted in  General  by  Mel Grubb
    Thu Apr 04 2019 12:54:34 GMT+0000 (Coordinated Universal Time)
    553 views
    4 comments
    How to upgrade SpecFor to use the Latest NUnit

    Want to run tests in VSTS. No tests seems to be running.

    Posted in  General  by  Deepali Khandekar
    Sat Apr 28 2018 03:02:27 GMT+0000 (Coordinated Universal Time)
    741 views
    1 comments
    SpecsFor<object?>

    I have a test I need to write that is for a static method on a static class. Since I don't need a SUT to be created, I don't really have anything to put between the angle brackets on the base class. I could just not inherit from SpecsFor at all, but then I have one mutant test that doesn't match the others in terms of style. I'd like to keep the pattern of overriding Given and When for consistency with my other tests. Is there an established or generally accepted pattern for this? I can inherit from SpecsFor<object> and it doesn't seem to complain, but can I count on this in the future?

    Posted in  General  by  Mel Grubb
    Thu May 11 2017 14:52:37 GMT+0000 (Coordinated Universal Time)
    880 views
    1 comments
    Constructor will be called before calling Given()-method

    Hello, I am using SpecsFor in Version 4.4.0. My application logic has a constructor and uses a Unity-Container like this: namespace SpecsFor_Unity { public class Program { static void Main(string[] args) { } public Program(object anyParameter, IUnityContainer unityContainer) { var foo = unityContainer.Resolve<IFoo>(); if (foo == null) { throw new ArgumentNullException(nameof(foo)); } } public void DoSomething() { } } } My test class Looks like this: namespace SpecsFor_Unity_Test { public class UnitTest1 : SpecsFor<Program> { protected override void Given() { var unityContainer = new UnityContainer(); unityContainer.RegisterType<IFoo, Foo>(); var program = new Program(new object(), unityContainer); } protected override void When() { SUT.DoSomething(); } [Test] public void then_check_anything() { } } } The problem is: the ArgumentNullException will be thrown after resolving unity reference, because constructor is called before Given()-method. I expected that constructor of Program is called within Given()-method. What am I doing wrong? Thanks in advance! Kind regards, Stefan

    Posted in  General  by  Stefan Petry
    Mon Mar 21 2016 12:18:31 GMT+0000 (Coordinated Universal Time)
    1,122 views
    2 comments
    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?

    Posted in  General  by  Mel Grubb
    Mon Jan 11 2016 14:28:02 GMT+0000 (Coordinated Universal Time)
    907 views
    1 comments
    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

    Posted in  General  by  Stefan Zilik
    Wed Feb 11 2015 09:28:51 GMT+0000 (Coordinated Universal Time)
    1,171 views
    2 comments
    Ask a Question

    Categories

    • All Categories
    • General
    readme.io
    Fork me on GitHub