I have a maven project (archtype quicksetup).
And I have a testcases annotated with #Test.
Is it possible to run the unit test from the Visual Studio Code UI ?
Microsoft finally released an extension for this exact purpose. However the documentation at this point is definitly lacking. I myself did not get it to work up to this point.
https://blogs.msdn.microsoft.com/visualstudio/2017/12/01/announcing-junit-support-for-visual-studio-code/
Related
in folder module/src/it I have my integration tests, configured with sbt like in:
https://www.scala-sbt.org/1.x/docs/Testing.html#Integration+Tests
but VSCode with metals shows me that does not see those classes, everything compiles fine with sbt. What can I do with it ? thanks!
edit:
rest of tests, main code etc works fine in vscode, only issue is with it tests folder
Ok looks like bloop does not support it and someone created ticket for them:
https://github.com/scalacenter/bloop/issues/1162
The VS Code plugin uses by default the JAVA_HOME environment variable (via find-java-home) to locate the java executable. Metals only works with Java 8 so this executable cannot point to another version such as Java 11.
https://olafurpg.github.io/metals/docs/editors/vscode.html
I just downloaded Visual Studio Code last night. What do I do so that Code will generate, say, a Console Application template?
I've read around the web so far I can't find anything telling me how to create a template.
Q: How do I create and run a new project?
A: VS Code doesn't include a traditional File > New Project dialog or
pre-installed project templates. You'll need to add additional
components and scaffolders depending on your development interests.
With scaffolding tools like Yeoman and the multitude of modules
available through the NPM package manager, you're sure to find
appropriate templates and tools to create your projects.
for details: https://code.visualstudio.com/docs/setup/setup-overview
and a question on SO: Run C# Console Application on Visual Studio Code Editor on Windows
I have downloaded the source for NHiberate 4.0.4 and want to run some of the unit tests. Not sure how to go about doing this. I played around with NUnit several years ago and seem to remember there was a addin for visual studio but couldn't find it. Is there a way to run the NUnit tests from within Visual Studio, similar to the way JUnit works in eclipse?
It's an old question but still deserves a step-by-step, how-to answer with reference to the latest versions of VS (2019) and NUnit (4.0) since NUnit tests won't run in VS 2019 out-of-the-box.
Here's how to set it up:
Install the NUnit 3 Test Adapter extension to VS by selecting Extensions > Manage Extensions from the main menu. Restart VS to complete the installation.
Add a Class Library project to your solution. Right click on the project and select Manage NuGet Packages menu option. Browse for NUnit and install it.
Add a public, non-static class to the project to host your tests. Mark the class with the [TestFixture] attribute. Also, don't forget to add the required using NUnit.Framework directive.
Add a public method to the class and mark it with the [Test] attribute. Repeat with as many methods as necessary.
Build the project and then select Test > Run All Tests from VS main menu. The Test Explorer will pop up and show you the progress and outcomes.
If you are using Visual Studio 2012 or higher, then yes, you can run NUnit tests directly from Visual Studio. I think NUnit Test Adapter
may be what you need. For VS 2013 and higher this may not be necessary - if NUnit Framework is installed and the project references it, anything declared as [TestFixture]/[Test] has a Click to Run icon on the left.
Hope this helps!
Say I have an NUnit test project written in C++/CLI, built with the /clr switch. That is, it can reference and use native code, it's not a pure managed assembly.
NUnit can run projects like these, but can this be done from Visual Studio using Resharper? I have R# 5.x, and I can't (can't even see the R# icons by the left edge of the code window to launch the tests). Can the latest version of R# do this?
ReSharper doesn't support C++/CLI, and thus it doesn't show Test icons in the source file. However, it should show tests from output assemblies in Unit Test Explorer (see ReSharper / Windows) and you should be able to right-click project and use Run Tests from context menu.
I am starting getting used to Eclipse, but I have much more experience with Visual Studio. In Visual Studio it is possible to run auto commands after the build has finished.
Now I am creating a GWT project and several other projects at once in one solution (or workspace) in Eclipse. Some files which are compiled with the GWT project needs to be copied to another location when they have been compiled. I am currently doing this manually and would like to do it automatically. I am not doing it often, since the project works fine in debug mode (...?gwt.codesvr=localhost:9997).
But where is the location for executing a post build command for a GWT project in eclipse? Is it possible?
Just open project properties, choose 'Builders' item and click on 'New...' button.
Good question! I'm using Eclipse since about 2003, and I remember that I also wanted a functionality like that back then. However, I got so used to using ant for any serious build, that I completely forgot about it.
There is some useful ant integration in Eclipse (e.g. the ant view), and if you create your GWT project with webAppCreator you already get a few good ant targets you can build upon.
It would still be nice sometimes to have something more GUI-like to do simple multi-step builds with Eclipse. I haven't found anything like that yet, but it's absolutely possible that it exists, especially as a plugin.