1

I was trying to execute a sample PNunit tests, but it is failing with the following error

The test xxx couldn't be found in the assembly xxx.dll

I have followed the Pnunit doc, but it is not helpful.

Project Refs

Here is the test case

using NUnit.Framework;

namespace TestLibraries
{
    [TestFixture]
    public class PuniTest
    {
        [Test]
        public void EqualTo19()
        {
            Assert.AreEqual(19, (15 + 4));
        }
    }
}

and the test.conf file

<TestGroup>
  <Variables>
    <Variable name="$agent_host" value="localhost" />
  </Variables>

  <ParallelTests>
      <ParallelTest>
        <Name>Testing</Name>
        <Tests>
          <TestConf>
            <Name>Testing</Name>
            <Assembly>pnunit35.dll</Assembly>
            <TestToRun>TestLibraries.PuniTest.EqualTo19</TestToRun>
            <Machine>$agent_host:8080</Machine>
          </TestConf>
        </Tests>
      </ParallelTest>
    </ParallelTests>

</TestGroup>

I have compiled the code, copied the "pnunit35.dll" and "test.conf" files to "NUnit.Runners.Net4.2.6.4\tools" folder to run the tests

And run the following commands (in batch file) to start the agent and run the scripts from Nunit test runner folder

start pnunit-agent 8080 .
pnunit-launcher test.conf

On running the batch scripts, tests are failing with the following error

The test TestLibraries.PuniTest.EqualTo19 couldn't be found in the assembly pnunit35.dll

Could some body please look into this?, thanks in advance

Srikanth Gurram
  • 1,022
  • 1
  • 10
  • 22
  • The name is `EqualTo19`, not `EqualTo20 ` – Guy Feb 20 '17 at 11:58
  • thanks for quick response. Sorry, that was a typo. An error message appeared for other test. The Actual message is " The test TestLibraries.PuniTest.EqualTo19 couldn't be found in the assembly pnunit35.dll" – Srikanth Gurram Feb 20 '17 at 12:02

3 Answers3

0

There is a chance you're missing the NUnit Test Adapter in Visual Studio.

Dawid Dworak
  • 310
  • 2
  • 12
0

You may have a processor architecture mismatch. If your project is 64bit, go to test -> test settings -> default processor architecure -> x64.

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
0

Thanks Everyone,

Finally I found root cause of the problem, it is the pNunit versions which is incompatible with the NUnit-3.6.0 and Nunit.Runner-4.2.6.4 I was using in my project.

When I googled about the issue, I found that pNunit-2.6.4 is not compatible with the latest Nunit-3.6.0. So, I have changed Nunit and NUnit.Runners to 2.6.4. Then the tests worked without any issues.

Update: Use .Net Framework 3.5

Update2: [.Net Framework 4.5] if you are working on .Net Framework 4 and above, start PNunit-agent in compatiblity mode.

Edit "pnunit-agent.exe.config" file in text editor and add the following code in 'configuration'

<startup>
    <supportedRuntime version="v4.0.30319" />
</startup>

Close the pnunit-agent and re-run that will solve the issue

Srikanth Gurram
  • 1,022
  • 1
  • 10
  • 22