2

I don't have enough rep to comment, so I am posting a question here. I read this question Get list of failing tests from Nunit. I am trying to implement the nunit addin, I used this code:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Core.Extensibility;

namespace NunitAddin
{
    [NUnitAddinAttribute(Type = ExtensionType.Core,
       Name = "addin",
       Description = "addin")]
    public class NunitAddin : IAddin
    {
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");
            if (listeners == null)
                return false;

            listeners.Install(this);
            return true;
        }
        public void TestStarted(NUnit.Core.TestName testName)
        {
        }

        public void TestFinished(NUnit.Core.TestResult result)
        {

        }
        public void RunStarted(NUnit.Core.TestName testName)
        {
        }

        public void RunFinished(NUnit.Core.TestResult result)
        {
        }

        public void UnhandledException(Exception exception)
        {
        }

        public void TestOutput(NUnit.Core.TestOutput testOutput)
        {
        }


    }
}

But when I call it using

var addin = new NunitAddin.NunitAddin();

var a = addin.Install(CoreExtensions.Host);

I get an error

NunitAddin.NunitAddin is not {0} extension point

on

 listeners.Install(this);

Does anyone know how to solve this problem?

1 Answer 1

2

Never mind, issue solved. Just a stupid mistake, I had NunitAddin : IAddin instead of NunitAddin : IAddin; EventListener

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.