nunit

New SIGABRT after upgrading to Mono 4 running NUnit tests

为君一笑 提交于 2019-12-24 03:26:43
问题 We upgraded from Mono 3.12.0 to 4.0.1 the other day and now our NUnit tests crash with a SIGABRT and some other information. So far Google has been of no help and I'm running out of things to try (minus a rollback to 3.12.0). I was just hoping someone could maybe take a look and help me find a new avenue to explore!enter code here I've tried the --shadowcopy switch, the --framework=v4.0/mono-4.0 switch, etc. Console Output: matt@matt-T420:~/bah3$ ~/Downloads/nunit3/bin/nunit-console.exe --

Testing local project in Visual Studio using selenium web driver

雨燕双飞 提交于 2019-12-24 01:45:17
问题 I am trying to set up a visual studio project with acceptance tests using NUnit and Selenium Web Driver, I would like to be able to "run tests" and this to start my web site, use selenium to run the tests and quit. I have this basic setup so far: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.PhantomJS; namespace FrontEndTests.AcceptanceTests { [TestFixture]

PartCover producing empty xml when upgrading applications to .Net 4.0

纵然是瞬间 提交于 2019-12-24 01:26:17
问题 We have been running PartCover on applications, and they were producing xml reports just fine. However, we upgraded all our applications from .Net 3.5 to .Net 4.0, and now, PartCover just produces an empty XML file. I tried upgrading to latest NUnit and latest PartCover, but that did not help. Is there anything else I can do to try to resolve this issue? We've been using code coverage frequently as part of our process, and need to resolve. This is the command: "C:\Program Files (x86)

How to use a single Log4Net instance in mutliple Nunit TestFixtures with SetUpFixture

北城余情 提交于 2019-12-24 01:25:27
问题 I'm just getting into the use of Selenium Webdriver and its EventFiring so that I can log any exceptions thrown by the driver to a file or email etc. I have got Log4Net working and my Unit Tests are running fine with Selenium. What I am having issues with is having Log4Net create 1 log file, but for multiple test fixtures. Here are some important classes which I think I need to show you in order to explain my issue. public class EventLogger : EventFiringWebDriver { // Not sure if this is the

nUnit Assert.That delegate concurrency issue

馋奶兔 提交于 2019-12-24 01:07:51
问题 I am experiencing some temporary dead lock in my code and can't wrap my head around it. Simple code (I cannot create a simple call chain to reproduce the code in InvokeChangeEvent ) [Test] public async void Test() { sut.InvokeChangeEvent("./foo.file"); // Event is handled by an async handler chaining multiple await resulting in a file write // await Task.Delay(3000); Assert.That(() => Directory.GetFiles("some dir").Count(), Is.EqualTo(3).After(15000, 300)); } I am aware that y'all (:D) want

Invalid System.Uri parsing under NUnit

本秂侑毒 提交于 2019-12-23 20:36:37
问题 Reproduced under ReSharper, from GUI-Runner, from NUnit-Console Tested on : Win 7 Pro, all updates, Ru-ru locale - reproduced Win Server 2012, all updates En-us locale - reproduced Try this: [TestFixture(Description = "Uri .ctors under Nunit must work exactly as no under Nunit")] public class InvalidUriCtorUnderNnit { [Test] public void PathsWithDotsMustBeParsedWell() { const string urlWithDots = "http://host.com/path./"; Assert.AreEqual(urlWithDots, new Uri(urlWithDots).ToString()); } }

Questions on unit testing of private methods

浪尽此生 提交于 2019-12-23 20:09:47
问题 In MSTest, the [Shadowing] attribute helps you to unit test a private method from another assembly. Here is the related link : What is the Shadowing attribute that the VS uses when it generates unit tests? My questions are: Should private methods be unit tested separately? Is it a good (?) practice to change private method's accessor to internal just to make it available for unit testing in some other test project/assembly? (using InternalsVisibleTo ) If private methods get tested indirectly

Expect exceptions in nUnit without the ExpectedException attribute

蹲街弑〆低调 提交于 2019-12-23 19:24:56
问题 I have methods with more than one parameter that are guarded against bad input by throwing ArgumentNullExceptions and ArgumentExceptions whenever any parameter is null. So there are two obvious ways to test this: One test per Parameter using the [ExpectedException] attribute One test for all parameters using multiple try{} catch blocks The try catch thing would look like that: try { controller.Foo(null, new SecondParameter()); Assert.Fail("ArgumentNullException wasn't thrown"); } catch

Partial Code Coverage C# - Nunit

情到浓时终转凉″ 提交于 2019-12-23 18:08:02
问题 I have partial code coverage and I don't know why. for people who like the question before they start reading Want to start by saying "First Post" as well as I am still very Junior in my development career but I have been a relativly quick learner(imo), so here it goes. Using Nunit to test, and MVP based. Code to be tested - void _view_Delete(object sender, EventArgs<Guid> e) { _agRepo.Delete(_agRepo.GetByID(e.Value)); var g = _agRepo.GetAll(); if (g.Count() > 0) { _view

Filter on Category for NUnit MSBuild tasks?

我是研究僧i 提交于 2019-12-23 17:22:05
问题 I'm setting up a MSBuild project to run some NUnit test, using the MSBuild Community Tasks Project. With these settings I'll be able to run the NUnit tests: <Target Name="Test" DependsOnTargets="Build"> <CreateItem Include="$(ProjectTestDir)\$(ClassLibraryOutputDirectory)\*.Tests.dll"> <Output TaskParameter="Include" ItemName="TestAssembly" /> </CreateItem> <NUnit Assemblies="@(TestAssembly)" /> </Target> ... but how can i run only certain tests - say the ones with a specific Category? We've