nunit

VS 2010 debugger not loading symbols when attaching to NUnit

こ雲淡風輕ζ 提交于 2019-12-19 05:11:04
问题 (I just posted this in the NUnit discussion group on groups.google.com) Under VS 2008, I would run my tests under NUnit, and, if I needed to debug, I would attach the VS2008 debugger to the running Nunit process (Debug -> Attach to Process), and set any breakpoints on code I wanted to examine. When I hit the Run buttion in NUnit, it would hit the breakpoint. (BTW, if it matters, this was running NUnit 2.5.2). I just upgraded to NUnit 2.5.4 and VS 2010. When I set a breakpoint, then attach to

NUnit 2.5.7 requires explicit Debug Attach under VS2010

拈花ヽ惹草 提交于 2019-12-19 04:04:25
问题 I've just "upgraded" from NUnit 2.5.2 to NUnit 2.5.7 so that I can run unit tests against an DLL's built with .Net Framework 4. I've been using 2.5.2 for a long time via the "StartExternalProgram" property under project properties. I've never had to explicitly debug attach to the NUnit process in that scenario. Now under 2.5.7 it appears that one must explicitly attach to the NUnit_Agent process in order to debug the code under test. Of course this means that instead of requiring two clicks

TFS Build 2010 Code Coverage using NUnit

允我心安 提交于 2019-12-19 03:41:36
问题 I was wondering if any of you guys had any experience generating code coverage reports in TFS Build Server 2010 while running NUnit tests. I know it can be easily done with the packaged alternative (MSTest + enabling coverage on the testrunconfig file), but things are a little more involved when using NUnit. I've found some info here and there pointing to NCover, but it seems outdated. I wonder if there are other alternatives and whether someone has actually implemented this or not. Here's

NUnit API And Running Tests Programmatically

北城余情 提交于 2019-12-19 03:40:50
问题 This is the first time I'm trying to hack into the NUnit interface, and am facing some issues. This is what I am trying to achieve: Take a set of string inputs as code files and compile them into an assembly take the in-memory assembly and pass it to NUnit for identifying and running the tests in this code This is what I have so far /// <summary> Validates whether the code files are valid </summary> public string Validate(string[] codefiles) { // To avoid NullReferenceException within NUnit /

Nunit-C#: run specific Tests through coding

大兔子大兔子 提交于 2019-12-19 03:15:54
问题 I am using Selenium with C# for Automation, and I want to invoke NUnit through code as follows: CoreExtensions.Host.InitializeService(); TestPackage testPackage = new TestPackage(@"D:\Automation\bin\Debug\Test.dll"); RemoteTestRunner remoteTestRunner = new RemoteTestRunner(); remoteTestRunner.Load(testPackage); //TestFilter filter = new NameFilter(new TestName() { Name = "Test1" }); TestResult testResult = remoteTestRunner.Run( new NullListener(), TestFilter.Empty, false, LoggingThreshold.Off

ReSharper Unit Test Runner - TestCase

半世苍凉 提交于 2019-12-18 19:40:22
问题 I like using the ReSharper unit test runner, but it doesn't support the TestCase attribute that was added in NUnit 2.5. Is there any hack to get round this? I can obviously use another test runner, but I like the ReSharper one. 回答1: I love ReSharper, but it does not yet support [TestCase]. However, take a look at the Gallio plug-in for ReSharper which does. http://www.gallio.org/ 回答2: Another solution that I use on Resharper version 5 is to use aspects with your tests. I'd love resharper 6

NUnit "could not load file or assemby 'MyTestProject'

泄露秘密 提交于 2019-12-18 18:49:37
问题 I'm setting up a new 64 bit machine to run as a build server. When I try to load my NUnit test assembly into NUnit GUI I get the following error. There is nothing obvious missing, all the dependencies seem to be present. All the DLLs are compiled for the x86 platform. Using NUnit 2.4.7. I have tried upgrading to 2.4.8 but the same error occurs. System.IO.FileNotFoundException: Could not load file or assembly 'MyTestProject' or one of it's dependencies. The system cannot find the file

Does anyone know where to find NUnit console exit codes meanings?

回眸只為那壹抹淺笑 提交于 2019-12-18 18:48:57
问题 I am getting error message from my MSBuild: "nunit-console.exe" exited with code -100. Does anyone know where NUnit console exit codes meanings can be found? 回答1: Error code -100 stands for UNEXPECTED_ERROR static ConsoleUi() { OK = 0; INVALID_ARG = -1; FILE_NOT_FOUND = -2; FIXTURE_NOT_FOUND = -3; TRANSFORM_ERROR = -4; UNEXPECTED_ERROR = -100; } EDIT: Additional information from a thread on the NUnit-Discuss google group: Additionally, positive values give a count of failed tests in the run.

Minimum NUnit binaries for an OSS project

浪子不回头ぞ 提交于 2019-12-18 16:51:09
问题 Open Source projects that ship with unit tests based on NUnit also usually ship the NUnit runners and accompanying binaries. For NUnit 2.4.8, distributing its bin directory verbatim with the actual project amounts to 46 files and a blank addins directory. What would be the minimum set of files needed if all one wanted was to distribute the GUI and console runners along with the base nunit.framework.dll required for authoring tests (and without the mocking infrastructure)? For reference, the

Has anyone successfully mocked the Socket class in .NET?

两盒软妹~` 提交于 2019-12-18 15:40:24
问题 I'm trying to mock out the System.net.Sockets.Socket class in C# - I tried using NUnit mocks but it can't mock concrete classes. I also tried using Rhino Mocks but it seemed to use a real version of the class because it threw a SocketException when Send(byte[]) was called. Has anyone successfully created and used a Socket mock using any mocking framework? 回答1: Whenever I run into these kinds of problems with Moq I end up creating an interface to abstract away the thing I can't mock. So in