nunit

Nunit and code coverage for C#

Hello everyone, I am using C# + .Net 4.0 + VSTS 2010. I am wondering whether Nunit is the best and easy to learn unit test tool for this platform (C# + .Net 4.0 + VSTS 2010)? If yes, I want to learn basics of Nunit, and also want to find how to generate code coverage report based on Nunit result (e.g. code coverage report to show which ...

Run NUnit 2.5.5 tests from within Visual Studio 2010 Ultimate and using .NET 4.0 code?

How can I do it? All the test runners seem to work for VS2008 but not 2010 and if they do, not for .NET 4. Thanks ...

How do I set up NUnit to run my project's unit tests?

I'm starting to use NUnit to write test cases in C# and Visual Studio 2010 and .NET 4.0. I want to use NUnit to test against a DLL (a C# class library project)'s public functions. How do I set up NUnit to work with my project? Should I add UNnit code to the same class library project to test against? Or add a separate project in the...

Nunit Tests order of Execution

This might seem a sily question to those who are well versed in autonmation but I am struggling with many things. Here's one: I am finding that the tests I created with Selenium RC in Visual Studio 2008 are getting run from NUnit in the alphabetical order of their names? What am I missing? Is there a way to organize the order in which...

Selenium, Nunit Best Practices?

Hello, I would like to learn more about how to use Selenium IDE and RC for creating good automation tests. Is there anybody who is interested in sharing info. or discussing this? Especially for things like: 1) What's a good way to organize the UI tests? Right now I am executing these tests thru NUnit and that executes the tests in the ...

NUnit 2.4.6 unable to find log4n 1.2.10 when launched from NAnt 0.91-alpha2

I have a .NET 3.5 web application, and I am adding Silverlight 4. I can build and test the whole project in VS 2010. My assemblies still targets 3.5. I had to upgrade NAnt from .85 to .91-alpha2 to get the build to work at all, and I had to use an call to msbuild v4.0.30319 rather than NAnt's task. That all works now (though if anyb...

Cruise Control .NET, .NET 4.0, WS 2008 R2, NUnit seems to require COMPLUS_Version ?

Trying to configure NUnit 2.5.8.10295 in Cruise Control.NET on Windows Server 2008 R2, .NET 4.0, my NUnit task times out, and nunit-agent.exe seems stuck running. It works fine from the command line. The only solution I've found is to define the environment variable COMPLUS_Version. Is there a better solution to this problem? C:...

Testing classes with threads, events, and private methods

hey guys general consensus I've done quite a lot of reading up on the subject of testing complex classes and private methods. The general consensus seems to be: "if you need to test private methods then you're class is badly designed" "if your class is complex, then you need to separate it out" So, I need your help. the problem C...

Where to instantiate interface in Nunit test

I think theres something really simple I'm missing so I apologize in advance. I'm trying to test an interface with Nunit. The interface is implemented by a class derived from a base class and I'm using Castle Windsor for IOC. I simply dont know where to assign the interface in the derived test class. Here is the base test class [T...

Data-driven testing in NUnit?

In MSTest you can do something like: [TestMethod] [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "testdata.csv", "testdata#csv", DataAccessMethod.Sequential)] public void TestSomething() { double column1 = Convert.ToDouble(TestContext.DataRow["column1"]); ... Assert.AreEqual(...); } What is the equivalent c...

What is the history of MSTest

A colleague of mine claims that Microsoft paid the developer of NUnit to develop MSTest. I have not been able to find any information that backs this claim up. Is this true? What is the history of MSTest? ...

Making a DynamicMock MockInstance equal to itself

Trying to use NUnit to test a method that adds an object to a queue, and throws an exception if the object's already been queued, but it fails because Queue.Contains() can't detect that the mock object's already in the queue. The method under test is pretty simple: public void Enqueue(ISomeInterface obj) { if (myQueue.Contains(obj)...

How to run tests conditionally in NUNIT?

I'd like to be able to set a condition from which to decide whether certain tests run in NUNIT. For example if a global variable x = 1 then only run the tests from a certain class/assembly or only run the first test. Is anything like this possible? How would one go about doing this? Thanks!! ...

pathnames for data files in nunit tests

In MonoDevelop, at least, I find that nunit tests launch with a CurrentDirectory of the bin directory. There's no apparent run option to change that. Is there some nunit-y nice way to locate data files, or should I just set an environment variable in the run configuration? ...