NUnit addin - should I include add-ons in every test project?

I recently found a useful post: NUnit Extension

However, my question still did not answer.

First, what is a test assembly ?

Secondly, can someone give me a more detailed explanation of " NUnit is looking for every test build to add add-ons "?

For example, I have two projects in my solution VS2010, say, project A and project B. A is a test project (contains "[Test]" inside), B is a project for adding NUnit (contains addin installer, EventListener interface implementations, etc. e. inside), and links A B. Does it work? Will the addin be called?

If not, I assume that this means that I should have various .cs files (which implement the addition of NUnit) that are directly included in project A, instead of putting them in a separate project and referencing it in a test project. Is that what you mean?

If so, another problem arose: when I have a project C, D, E ... which are also test projects, I have to include these different .cs files (which implement the NUnit add-on) in each test project

+5
source share
2 answers

This is the answer that Charlie gave in google groups. Thanks a lot Charlie! https://groups.google.com/forum/?fromgroups#!topic/nunit-discuss/yTKRKf2APLI

Re: [nunit-discuss] Re: NUnit extension

, 21 2012 8:13, Athrun Sun ():

,

: "NUnit "?

, VS2010, , A B. A - ( "[Test]" ), B - NUnit ( addin installer, EventListener .. ), A B. ? ?

. B .

, , , .cs( NUnit), A, , . , ?

, : C, D, E... , .cs( NUnit) ?

, . , , , NUnit , .:-)

addins . , . , , .

- -

, https://groups.google.com/d/msg/nunit-discuss/-/a730uESbNJUJ. - -

+1

:

  • - .dll, AddIns.
  • , .

, NUnit , :

Addin

public class CustomEventListener : IAddin, EventListener
{
    public bool Install(IExtensionHost host)
    {
        IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");
        if (listeners == null)
            return false;

        listeners.Install(this);
        return true;
    }

    ........ <Implemented Interfaces> .......

}

:

[NUnitAddin]
public class MyAddin : CustomEventListener { }

NUnit NUnitAddin CustomerEventListener, .

+4

All Articles