Visual Studio For Mac Nunit

Please complete the security check to access this website.

Why do I have to complete a CAPTCHA?

Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.

NUnit tests against.net core project in Visual Studio for Mac causing freezes, Unable to debug and unrelaiable Unit Tests view. Reported by Jeremy Connor Jun 26, 2017 at 04:46 AM visual studio for mac debugger. If you're using Visual Studio for Mac the NUnit templates extension can't be used. This guide assumes that you have a solution with either a PCL or a Shared project and a number of platform specific projects. NUnit is an excellent piece of software that has greatly improved the quality of.NET code throughout the world. However, I feel it has a small usability problem in that when you want to run all your tests in a solution from Visual Studio, you have to manually set up a NUnit project file to do so.

What can I do to prevent this?

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

For

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

Nunit Tutorial Visual Studio

commented Dec 4, 2015

I'm talking about the kind of stuff that shows up in the 'output' tag of the generated reports.

commented Dec 4, 2015

We are limited by what Visual Studio provides and there may not be anywhere to add this, but a good idea if there is. @OsirisTerje do you think it is possible?

commented Dec 4, 2015

@DerekSMorin I think you must have used an html tag, so something isn't showing up in your request, but I think you are referring to the output element in the XML.

We could indeed show this in the output window, if desired. I'm concerned that it would seem like too much output for some folks, so I'd like to be able to enable it selectively. For that reason, I think this has to wait until we implement #49.

added is:featurepri:normalVS Issue labels Dec 4, 2015

commented Dec 7, 2015

I assume you mean the Output window, set to output from Tests:

Given this code

The Test output will be

The Trace and Debug Writeline will appear in Output Debug window.

The adapter writes to the Output Test window today, but that is information from the execution of the test. That is what this is intended for. We could add things to this window, but I am unsure if that would not be confusing.

If this what you meant?
If so, I think we need to clarify what is really wanted and needed here.

commented Dec 7, 2015

I'd say that putting the output into the Test Output, as we now do, should be sufficient. But let's wait a beat to hear from @DerekSMorin about why he feels it isn't.

commented Dec 7, 2015

The Console.WriteLine messages are not showing up in the 'Test' output window. That is where I was expecting to see them. I think part of it is that when running the tests, the output window switches to show the 'Test' output - so I'm expecting to see the same output there as I would see when running from the command line. To be clear, I'm talking about the first picture in OsirisTerje's post.

commented Dec 7, 2015

Isn't the fact that the console output is going to the test window (3rd image) what you would expect? That at least groups the output with the tests themselves giving context.

commented Dec 7, 2015

Note that it wasn't possible to group the output this way under NUnit 2.6.4. NUnit 3.0 enables it by grouping output with each result and the NUnit 3 adapter takes advantage of it.

commented Dec 7, 2015

As you start to run you see messages like:

------ Run test started ------
NUnit Adapter 3.0.8.0 executing tests is started
Running selected tests in C:DevelopmentSourceDotNetbinx64DebugActivityReport.dll
Loading tests from C:DevelopmentSourceDotNetbinx64DebugActivityReport.dll

Then I am waiting to see more output but nothing shows up.

The window in the first picture says:

Show output from: Tests

I would expect to see output from the tests here. I do see now that I can see the output by clicking on a test, and then clicking the Output link.

I looks like regular visual studio tests operate the same way - I guess I was misintepreting the phrase: 'Show output from: Tests'

commented Dec 7, 2015

The problem with sending the Console output to the Output/Tests window is that it is normally filled with a lot of execution information, and as @rprouse says, the context will be lost, because there is no information there about which test is being executed. It will also deviate from the way MSTest and XUnit is working.
Also, with the new parallell execution in VS2015 U1 (and NUnit and XUnit), a simple text output may not make much sense.

commented Dec 7, 2015

@OsirisTerje I agree with your conclusion but I have to add to it that a simple text output is actually not even possible with NUnit 3.0 if by that we mean one line at a time as the test executes. All output is now trapped and is included in the test result from NUnit.

I have wondered if we should handle console error output one line at a time, but that would require a change in the code.

@DerekSMorin In both NUnit and the adapter, associating the output with the test was designed as an improvement and most people find that to be the case. The console output works that way as well now except, of course there is only one place to look for it. :-)

commented Dec 8, 2015

@OsirisTerje I intended to close this as well. I'll add the label.

added closed:wontfix and removed VS Issue labels Dec 8, 2015

Closed

commented Aug 14, 2016

So now we have to switch to the Test Explorer, click on the test, then click on the output link to see our test output?
👎 for productivity 😦

commented Nov 10, 2016

I have the same issue where I don't see output in the Output:Tests window, but I do see it in the log4net log, and the output generated by the test. I'm using VS2012. With NUnit 2.6.4 I saw output to the Output:Tests window as expected, but after upgrading to 3.4.1 (to match the version on our Bamboo server) we no longer get output to the Output:Tests window.

When it was working I would see output like this:

Now the Output:Tests looks like this

Where are my log4net and Console.Write statements in the Output:Tests window?

commented Nov 10, 2016

@dmorsebu Note that you are commenting on an issue that was closed almost a year ago. The location of your output is explained in the earlier comments. Start a new issue if it's absolutely necessary but please consider the explanations given as to the reasons for the change before you do.

Open

commented Jul 24, 2018

After the test are run.I can just see the status as passed or failed but i want to see the results of test cases such as which id was fetched and etc.But right now there seams to be no way of doing that.

commented Jul 24, 2018

@malikmahak91 If you just want to see that information, you can enable the dump files using the runsettings for that. You will then get a file with all the information that comes from the NUnit.Engine. See https://github.com/nunit/docs/wiki/Tips-And-Tricks

commented Jul 25, 2018

okay i will try that

commented Jul 25, 2018

where do we save the settings file and is it different from config file?
and the name of settings file is .runsettings?

commented Jul 25, 2018

I am not using nunit in my test.I have build the unit test using selenium(C#)

commented Jul 25, 2018
edited

Selenium is using nunit and the nunitadapter under the hood, so it will honor a runsettings file.
And yes, it should have the extension .runsettings and name can be whatever, and just let it stay somewhere easy, like the root of your repo. You need however to tell selenium/nunittestadapter that it should use the particular runsettings file, and I am not so familiar with Selenium, but it should be there somewhere. You can download an item template for the runsettings from the marketplace (https://marketplace.visualstudio.com/items?itemName=OsirisTerje.Runsettings-19151), which has the general layout and the NUnit section. Just add the dump statements within the NUNit section (you dont need anything of the rest there, so let that stay commented). If you run from command line, you should be able to do like: vstest.console whatever.test.dll /Settings:selenium.runsettings. You can also add the runsettings in Visual Studio using the Test/Test settings menu.
I assume you do Selenium a bit like described here: https://almvm.azurewebsites.net/labs/vsts/selenium/, and then it is just like any other unit tests :-)

commented Jul 25, 2018

I downloaded the template and it got installed in visual studio but how we access it?
sorry, I am a newbie.

commented Jul 25, 2018

i have added the file but there is no code..wheever i click on file it starts the process of saving it.

commented Jul 25, 2018

i do not want deployment so unchecked that and then it asks for set script and clean script,which i do not have.

commented Jul 25, 2018

commented Jul 26, 2018

@malikmahak91 1. You have added a testsettings file, please delete that. You need a runsettings file. 2. As you have installed the template (and restarted VS), you go to the Solution root, right click, and Add new item.

You should then see a list of possible types.
Choose the Parallel one, not because it does parallel, but just because this is the simplest one.
After adding it, open it,
Add the section marked with red. This enables the execution dump.
Now, enable this settings file, the same way as mentioned above
RUn your tests in Visual Studio, and then look in your test projects binary output folder, there should now be a Dump folder there, containing the dump file
In my case it is the bin/Debug/net471 folder that is my output (1), and the Dump folder contains the
dump file (2).
Hope this helps :-)

commented Jul 26, 2018

Thankyou so much for explaining so beautifully.
All the results are getting pushed to i think some file.But i am not able to find a dump file yet.

commented Jul 26, 2018

commented Jul 26, 2018

I found the file. :)

Visual Studio For Mac Nunit

commented Mar 17, 2019

we get to discuss with KINGSGODS , GitHub Rocks!!

Visual Studio For Mac

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment