unit

Running unit tests under Chess

When trying to run my unit test under Chess, it get the following error: Hosting rules specify that the test type 'Unit Test' cannot run in the host adapter 'Chess'. To run this test in 'Chess', change the hosting rules. To use the default test host for tests that cannot be run in the specified host adapter, change the te...

MS Unit Tests accessing private methods and base class members

Hi Today I ran into a problem where I cannot call the ControllerContext in my Controller, within the MS Unit Test method when accessing via a private method. For example //This is my controller and private GetUsers() method public class SampleController : Controller { private IEnumerable<Users> GetUsers() { ...

Unit testing framework for .NET, Comparison!

I have used a bit of MS VS2008 integrated Unit Testing framework for writing unit test, but not that extensive, any suggestions which framework will work best for web based applications developed using ASP.NET. ...

Unittesting aspect-oriented features.

Hi, I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security? These things are sort of omni-present in the application, so how to test them properly? E.g. say that I'm...

Dependency breaking techniques using dependency Inj for unit testing

Currently reading "The Art of Unit Testing" by Roy Osherove. I'm about half way through it and so far it's an awesome book. I'm going to ask everyone to leave IOC containers out of this discussion. He only briefly mentions them (actually states IOC are out of the scope of the book which I don't understand and is one of the few places whe...

Test presenter in ASP.NET Web Form

Hi, I am working on an ASP.NET WebForm application using MVP pattern. For every Web Form, there is a Presenter class associated to handle UI and Business logic. However, I had problem when writing unit tests for Presenters, since session values are used in presenters. And there is no HTTP context exists during execution of the unit tes...

Are there real differences between NUnit and Microsoft's Unit Testing Framework (VS 2008)?

With the framework that Visual Studio 2008 has, am I missing anything great by NOT using an external tool like NUnit? From what I can tell it seems like using NUnit would be more of a hassle with manually creating test classes and methods versus the right clicking native to the IDE. That being said, am I missing features that NUnit pro...

How do I write color text to the Visual Studio output window from c#?

I want to write color text to the Visual Studio output window from c#. I want to output red code from my unit tests. ...

How do you set a custom session when unit testing with wicket?

I'm trying to run some unit tests on a wicket page that only allows access after you've logged in. In my JUnit test I cannot start the page or render it without setting the session. How do you set the session? I'm having problems finding any documentation on how to do this. WicketTester tester = new WicketTester(new MyApp()); ((M...

Separate Database for Integration Testing

I am performance integration testing where I fire up the ASPX pages using WatiN and fill the fields and insert into the database. There are couple of problems that I am facing. 1) Should I use a completely separate database for integration testing? I already gave db_test and db_dev. db_test is for unit testing and is cleared after each...

Unit Testing Custom Code Analysis Rules in 2010 - Any Hope

In the past it has been a real PITA to unit test custom Code Analysis rules. I haven't found anything out there that shows the situation to be any different in 2010, but I'm not giving up. If anyone knows if this is "possible" in 2010 please respond - thanks! ...

How apply Unit tests in ASP.NET webforms

Hi guys. I'm developing a website in asp.net webforms with 3 layers; UI, BLL and DAL The website is already developed, but i like have more control about the unit tests of each form Pass specific values at specific inputs for i see, if application survives or not. I already study about NUnit but in webforms in UI layer how can apply t...

Are ActiveRecord:Observer callbacks called during unit testing?

I'm trying to unit test an observer in rails but none of its callbacks are being invoked. I'm sure I have something configured incorrectly but just to be sure I was wondering if this may be a Rails limitation during unit testing. I've looked at the docs and they don't mention anything. ...

WCF MSMQ Unit testing

I have created a custom msmq service with WCF, which uses a custom binding as it needs to do some custom logic at the channel layer, where it calls another wcf service. The service is going to be a core pience of functionality for our systems for at the the next few years. i want to do what I can to make sure the service is robust, but, ...

JQuery height and units

Hello.. I know that height() method of jquery returns a number unitless... How can i be sure that this number is in the unit i want? I want to work with centimeter cm any ideas? ...

Unit Testing a Java Chat Application

I have developed a basic Chat application in Java. It consists of a server and multiple client. The server continually monitors for incoming messages and broadcasts them to all the clients. The client is made up of a Swing GUI with a text area (for messages sent by the server and other clients), a text field (to send Text messages) and a...

New NCover 3.4.2 makes all my MSTest unit tests fail

Yesterday, I decided to install the newest NCover version (3.4.2). However, when I ran it on my existing .ncover configuration file, the NCover output suddenly reported that all my MSTest tests failed. Of course those tests succeed when ran within Visual Studio. Because of this, NCover isn't able to determine any coverage. Somehow the o...

C# testing framework that works like JUnit in Eclipse?

Hello all, I come from a Java/Eclipse background and I fear that I am spoiled by how easy it is to get JUnit and JMock running in Eclipse, and have that GUI with the bar and pass/fail information pop up. It just works with no hassle. I see a lot of great options for testing in C# with Visual Studio. NUnit looks really nice because it co...

Unit Testing Error - The unit test adapter failed to connect to the data source or to read the data

I'm using VSTS 2K8 and I've set up a Unit Test Project. In it, I have a test class with a method that does a simple assertion. I'm using an Excel 2007 spreadsheet as my data source. My test method looks like this: [DataSource("System.Data.Odbc", "Dsn=Excel Files;dbq=|DataDirectory|\\MyTestData.xlsx;defaultdir=C:\\Tes...

unit test SqlCacheDependency

I'm using SqlCacheDependency in asp.net application, and i'm using HttpRuntime.Cache to cache items. and the application works well only when i debug the web application, but the HttpRuntime.Cache will not be notified when some data changes from the db when i debug the application in the unit test mode. Anyone have suggestions to make H...