Nancy test doesn't find route in other assembly

后端 未结 1 1714
遇见更好的自我
遇见更好的自我 2021-01-24 07:17

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

public class when_a_user_logs_in_successfully
{
    static Browser _browser;
    static Browse         


        
1条回答
  •  南方客
    南方客 (楼主)
    2021-01-24 07:49

    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 讨论(0)
提交回复
热议问题