Q: Nunit. Take screenshot on test failure using ITestListener I want to take screenshot of a failed test case. But I don't know how to force Nunit to use my listener.
I was trying to use IAddins, but Nunit doesn't have NUnit.Core.Extensibility lib. 
My code:
using System;
using OpenQA.Selenium;
using NUnit.Framework.Interfaces;
using AT_MentoringPortal.Driver;
using System.Drawing.Imaging;

namespace AT_MentoringPortal.listeners
{
    public class ScreenshotListener : ITestListener
    {
        private readonly string path = ".//screens//";

        public void TestFinished(ITestResult result)
        {
            if (result.ResultState.Status == TestStatus.Failed)
            {
                IWebDriver driver = DriverFactory.GetDriver();
                this.MakeScreenshot(driver, result.Name);
            }
        }

        public void MakeScreenshot(IWebDriver driver, string testName)
        {
            string timestamp = DateTime.Now.ToString("yyyy-MM-dd-hhmm-ss");
            var screenshot = ((ITakesScreenshot)driver).GetScreenshot();
            screenshot.SaveAsFile($"{this.path}{timestamp} {testName}", ImageFormat.Jpeg);
        }

        public void TestOutput(TestOutput output)
        {
           // throw new NotImplementedException();
        }

        public void TestStarted(ITest test)
        {
           // throw new NotImplementedException();
        }
    }
}

Please, show me how to start my listener in test class.

A: ITestListener is an internal interface used by NUnit itself in running tests. There was a similar interface in NUnit V2 (TestListener) and you were able to create addins that used it. NUnit 3 doesn't have addins in the way that NUnit 2 did, although it can be extended in other ways.
Did you want to save a screen shot for only certain tests? Or for each test in a certain fixture? Or more generally?
To do it within a fixture, you could use a OneTimeTearDown method.
