nunit

Nunit .Net Core Parallel Tests

自古美人都是妖i 提交于 2019-12-13 18:32:41
问题 This was mentioned by Charlie Poole : If you are running .NET Core tests, you are using the NUnit portable framework build, which does not support parallel execution. The attribute is still accepted so that you can switch to different platform builds without changing the code Does any one know if this is still the case ? 回答1: Yes, this is still the case as of NUnit 3.8.1. Even though the Portable version of the framework has been replaced by a .NET Standard version, parallel test execution

How to disabled shadow copy in nunit from console exe

谁都会走 提交于 2019-12-13 18:28:32
问题 I am trouble with loading Nunit test dll. The test dll is using some other exe which copied few directory and files when they builds. I have recevied that error when call test.dll from nunitconsole.exe System.IO.DirectoryNotFoundException: Could not find a part of the path The console parameters are as follows: C:\Program Files (x86)\NUnit 2.6.2\bin\nunit-console.exe" /xml:"C:\abc.xml" "D:\Project\UnitTestProjct\RGTestingToolTestProject\NUnitTestProject\bin\Debug\NUnitTestProject.dll" Please

Using MVCContrib.TestHelpers with MsTest - is there any way to get nicer fail messages?

假装没事ソ 提交于 2019-12-13 16:13:24
问题 I'm just starting to use MVCContrib, and I'm really liking the syntactic sugar it adds to various test scenarious. For example, I just wrote this assertion: "~/".Route().ShouldMapTo<SpotController>(c => c.List()); It's brilliant! Well, almost... Instead of, as I'd like, seeing the actual reason why the test fails (I've changed nothing in my MVC application, so that should route to HomeController.Index() ) I get the generic message about an exception being thrown during test execution. This is

Unit testing generic htmlHelper methods with nunit

有些话、适合烂在心里 提交于 2019-12-13 15:05:03
问题 I'm new to nUnit and I've been tasked with creating unit tests for some htmlhelper extension methods. How should I go about creating a unit test for the following method? public static MvcHtmlString EnumDropDownListForOrderBy<TModel, TEnum>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TEnum>> expression, bool orderById, string firstElement = null, object htmlAttributes = null) { ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); Type

Set a mock GPS location on an Android device

这一生的挚爱 提交于 2019-12-13 12:51:45
问题 I am working on automating some device/server testing we do on various android devices. I need a way to set a specific GPS lat/long on an actual Android device that is usable within a NUnit testing framework. Any help on this will be appreciated. 回答1: You need to set Allow mock locations true under Developer settings . After that you can write some small utility app which will set mock location on receiving some custom event. You can then set location using adb shell command e.g $ adb shell

VS2017 and NUnit 3.9 No test is available

为君一笑 提交于 2019-12-13 12:23:43
问题 I am using the latest VS2017 version 15.6.4, NUnit3TestAdapter 3.10.0 and Nunit version 3.9.0.0. When I try to run a unit test in Test Explorer the test are grayed out, when I right click and and run selected tests I see the following error: No test is available Here is how my test class looks [TestFixture] public partial class ListViewBOTest { [Test] public void TestSearch_DateTime() { Assert.AreEqual(1,0); } } Text from output: [3/26/2018 10:53:55 AM Informational] ------ Run test started -

Setting up NCover for NUnit in FinalBuilder [closed]

冷暖自知 提交于 2019-12-13 12:09:17
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . Solved: Look at the bottom of this question for the working configuration I am attempting to set up NCover for usage in my FinalBuilder project, for a

Integration tests - what would you test for in this controller?

a 夏天 提交于 2019-12-13 10:29:23
问题 I'm applying NUnit integration tests on our controller endpoints in a .NET Web API 2 project whose models and controllers are generated via Entity code first from database . I'm having trouble thinking of what parts of the controller I should test. In the end, we'd just like to be able to automate "can a user with "x" role get this data?" Looking in the GET portion of this controller, what parts would you test and what's your reasoning? namespace api.Controllers.myNamespace { public class

Reporting tool for Nunit 3 and Selenium C#

眉间皱痕 提交于 2019-12-13 08:27:37
问题 I'm using Selenium with C# to create my automated tests. Now i have to use some sort of reporting tools to save the test cases whether they passed,failed...etc. I've seen a lot of tools like Allure, and Jenkins. But they require an XML file. and i can't find it when i run my tests using Visual 2013. Why is that ? how to obtain these XML files in details if i'm missing something ? Is there any way i could achieve this with minimum effort ? EDIT: How can i run my tests using Nunit console

Configuring Nunit with ASP.NET MVC Core 1.0

青春壹個敷衍的年華 提交于 2019-12-13 08:24:38
问题 I wanted to configure NUnit for my ASP.NET Core 1.0 project. I have tried following : http://www.alteridem.net/2015/11/04/testing-net-core-using-nunit-3/ , but it's there for console applications. If I try to attach a new project (class library) to my solution and then try to reference my original project - it gives me reference error. Here is what worked for me: I attached another web app project, dedicated to writing tests, to my original project, as opposed to the console library project.