Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6810157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:10:21+00:00 2026-05-26T20:10:21+00:00

I have the following spec (using Machine.Specifications or mSpec): public class when_a_user_logs_in_successfully { static

  • 0

I have the following spec (using Machine.Specifications or mSpec):

public class when_a_user_logs_in_successfully
{
    static Browser _browser;
    static BrowserResponse _response;

    Establish context = () =>
        {
            var bootstrapper = new ConfigurableBootstrapper();

            _browser = new Browser(bootstrapper);
        };

    Because of = () => _response = _browser.Get("/Login", with => with.HttpRequest());    

    It should_return_a_successful_response = () => _response.Body.ShouldNotBeNull();
}

The route from the spec should find the following module:

public class LoginModule : NancyModule
{
    public LoginModule()
    {
        Get["/Login"] = parameters => "test";
    }
}

But for some reason, the response has a status of “NotFound” and a Body that throws an exception saying the stream is closed/disposed. My specs solution has a reference to the assembly that contains the LoginModule. What else should I do to make the spec find the route in the module?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:10:21+00:00Added an answer on May 26, 2026 at 8:10 pm

    It’s because you don’t have any “hard reference” to the other assembly (i.e. you’re not using any of the types in there directly), because of that .Net doesn’t load it and Nancy won’t find it.

    We have an AppDomainAssemblyTypeScanner that you can use to load your assemblies (there’s a few methods in there you can use to load a wildcard set of DLLs), or you can bodge it by adding a variable of one of the types in your main assembly into your test assembly.

    I think in the future we’ll have to change the test runner to load every DLL it can find by default, with the option to change that if it causes issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following classes. class A { public: void fun(); } class B: public
I´m testing my rails app using rspec and remarkable. I have the following spec
I'm using RavenDB build 371 and I have the following model: class Product {
In a branch spec, I have the following view: //depot/dev/t/a/g/... //depot/dev/t/r/g/... -//depot/dev/t/a/g/p/o*/... //depot/dev/t/r/g/p/... Perforce
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have tree with the following node spec: java.util.TreeMap<Long id, java.util.TreeMap children> When I
I have the following XML example: <?xml version=1.0 encoding=UTF-8?> <OpenSearchDescription xmlns=http://a9.com/-/spec/opensearch/1.1/ xmlns:custom=http://example.com/opensearchextensions/1.0/> <ShortName>Test</ShortName> <Description>Testing....</Description>
I have the following code for getting a resource using name instead of id:
I have following xml file: <doc_xml> <nodes> <node id='1' spec={spec_a=0.9, spec_b=0.1} /> <node id='2'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.