These are chat archives for petabridge/akka-bootcamp

9th
Sep 2016
Jon Blackburn
@jeblackburn
Sep 09 2016 20:47
Sorry if this has been covered before, I'm struggling with Gitter search. I found a post that indicated in January that Akka.Testing.NUnit does not support NUnit 3.x. Is that still the case?
Marc Piechura
@marcpiechura
Sep 09 2016 20:48
@jeblackburn nop, we have a separate nuget package for NUnit 3 support
Jon Blackburn
@jeblackburn
Sep 09 2016 20:49
D'oh! Staring me in the face. Thanks @Silv3rcircl3.
Marc Piechura
@marcpiechura
Sep 09 2016 20:51
Np :)
Jon Blackburn
@jeblackburn
Sep 09 2016 21:27
Spoke too soon. Now I have a Unit Test Sessions window with "<MyUnitTest> is pending" in the output tab and no tests found. Any thoughts?
Marc Piechura
@marcpiechura
Sep 09 2016 21:35
it's working for me for a fresh class library and R#
Jon Blackburn
@jeblackburn
Sep 09 2016 22:05
If I build a TestFixture that extends TestKit and has a pair of no-op Tests in it, then the NUnit console runs the tests just fine. If I change that test just to extend TestKit, it fails to find the class as a TestFixture at all.
Marc Piechura
@marcpiechura
Sep 09 2016 22:06
What do you mean with no-op tests?
Jon Blackburn
@jeblackburn
Sep 09 2016 22:07
[TestFixture]
public class CashCapitalRestApiTests : TestKit
{
    [Test]
    public void TestSomething()
    {
        Assert.True(true);
    }

    [Test]
    public void ShouldReturnPositionInfoAsJson()
    {
        Assert.True(true);
    }
}
That code runs fine if I comment out ": TestKit"
Marc Piechura
@marcpiechura
Sep 09 2016 22:09
Do you have a using statement like "using Akka.TestKit.NUnit3" ? The 3 matters
Jon Blackburn
@jeblackburn
Sep 09 2016 22:10

Here's the whole file.

using Akka.TestKit.NUnit3;
using NUnit.Framework;

namespace CashCapital.Web.Test
{
[TestFixture]
public class CashCapitalRestApiTests : TestKit
{
[Test]
public void TestSomething()
{
Assert.True(true);
}

    [Test]
    public void ShouldReturnPositionInfoAsJson()
    {
        Assert.True(true);
    }
}

}

This message was deleted
Marc Piechura
@marcpiechura
Sep 09 2016 22:12
blob
I try with the nunit console runner
Jon Blackburn
@jeblackburn
Sep 09 2016 22:12
Visual Studio 2015?
Marc Piechura
@marcpiechura
Sep 09 2016 22:12
yup
blob
Jon Blackburn
@jeblackburn
Sep 09 2016 22:15

I've even tried with the NUnit console.

Test Run Summary
Overall result: Passed
Test Count: 2, Passed: 2, Failed: 0, Inconclusive: 0, Skipped: 0
Start time: 2016-09-09 22:03:11Z
End time: 2016-09-09 22:03:12Z
Duration: 0.064 seconds

D:\dev\backoffice\trunk\cashcapital\CashCapital.Web.Test\bin\x64\Debug>"c:\Program Files (x86)\NUnit.org\nunnit3-console.exe" CashCapital.Web.Test.dll
NUnit Console Runner 3.4.1
Copyright (C) 2016 Charlie Poole

1) Invalid : D:\dev\backoffice\trunk\cashcapital\CashCapital.Web.Test\bin\x64\Debug\CashCapital.Web.Test.dll
Has no TestFixtures

Run Settings
WorkDirectory: D:\dev\backoffice\trunk\cashcapital\CashCapital.Web.Test\bin\x64\Debug
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 8

Test Run Summary
Overall result: Failed
Test Count: 0, Passed: 0, Failed: 0, Inconclusive: 0, Skipped: 0
Start time: 2016-09-09 22:03:32Z
End time: 2016-09-09 22:03:32Z
Duration: 0.055 seconds

I'll try in an isolated project, see if that makes a difference.
Marc Piechura
@marcpiechura
Sep 09 2016 22:17
I guess this comes from a run without ": Testkit"?
Test Run Summary
Overall result: Passed
Test Count: 2, Passed: 2, Failed: 0, Inconclusive: 0, Skipped: 0
Start time: 2016-09-09 22:03:11Z
End time: 2016-09-09 22:03:12Z
Duration: 0.064 seconds
Jon Blackburn
@jeblackburn
Sep 09 2016 22:18
Ya, that was two runs, one with & one without.
Jon Blackburn
@jeblackburn
Sep 09 2016 22:37

AHA!!!

If I use nunit's latest release (3.4.1) my issue shows up. If I use v3.0.4 (the one pulled in by NuGet as a dependency of Akka.TestKit.NUnit3), everything works fine.

@Silv3rcircl3, thanks for your help. I might take a look over the weekend to see what I can see. Have a good weekend.

Marc Piechura
@marcpiechura
Sep 09 2016 22:39
Np, you too.