0

I'am totally new to Windows Store App programming, so i'am also new to Visual Studio Express.

My goal is to test a simpple class method. As mentioned here the Express version do not have any built-in Unit testing. In this thread, Rafal provides a solution.

I exactly did it like described, so my external tools look like this:

enter image description here

When i execute it (Tools --> "Execute NUnit"), Nunit starts and the Gui of NUnit appears. But suddenly this exception occurs:

enter image description here

And in Exception Details:

System.IO.FileNotFoundException...

   at NUnit.Util.ProjectService.WrapAssembly(String assemblyPath)

   at NUnit.Util.ProjectService.ConvertFrom(String path)

   at NUnit.Util.ProjectService.LoadProject(String path)

   at NUnit.Util.TestLoader.LoadProject(String filePath, String configName)

My project folder has this structure:

enter image description here

The test classes are in "WebTest.Shared".

I think i need a .dll to run in NUnit as mentioned by Jon here. So, how can I make a dll out of my project to run it with NUnit? Can anyone guide me through this problem? (Please step by step)

EDIT:

After i worked in ChrisM idea, the exception stll arises without "${BinDir}${TargetName}.dll/run" block (the exception details are the same as before):

enter image description here

EDIT No. 2:

I have set those values:

Title: Execute NUnit

Command: D:\Path\To\NUnit\bin\nunit.exe

Arguments: $(BinDir)$(TargetDir)$(TargetExt)/run

Initial directory: $(BinDir)

EDIT No. 3:

After closing and reopening VS Express i got this new Exception: newException

And in NUnit Exception Details:

System.ApplicationException: Unable to find test in assembly

System.ApplicationException...

EDIT No. 4

Here is my test class (StringUtilitiesTest.cs):

using System;
using System.Collections.Generic;
using System.Text;
using WebappTest.Shared.Utilities;
using NUnit.Framework;

namespace WebappTest.UnitTest


{
    [TestFixture]
    public class StringUtilitiesTest
    {

        [Test]
        public void TransferFunds()
        {

            Assert.AreEqual("Hello", StringUtilites.getString("Hello"));

        }
    }
}
Community
  • 1
  • 1
A.D.
  • 1,412
  • 2
  • 19
  • 37

2 Answers2

0

In external Tools:

Have you tried replacing the curly braces {} in the argument box with normal ones ()?

ChrisM
  • 1,148
  • 8
  • 22
  • Can you please post the content of the "Argumente" field? – ChrisM Oct 09 '14 at 13:37
  • hmm... I don't know what is causing your problem. From what you stated so far, I am guessing that NUnit can not find the Assembly containing your tests because for some reason the visual studio environment variables ( e.g. $(BinDir) ) are not working or contain wrong information. If I am right entering the absolute path to the assembly containing your tests ( webappTest.shared if I got you right ) into the arguments should make it work at least. Can you try that? – ChrisM Oct 10 '14 at 10:35
  • Looks like there is an attribute missing in your test class. Can you post the test class here as well? – ChrisM Oct 13 '14 at 07:29
  • That looks correct. I'm afraid I've got no further idea, sorry. – ChrisM Oct 14 '14 at 08:58
0

Visual Studio 2017 Express (the final express version) includes the test explorer. Add the NUnit3TestAdapter NuGet to your project, and the test explorer should discover your tests.

tm1
  • 1,180
  • 12
  • 28