unit-testing

Unit testing fxcop custom rules

Hi all, I would like to test my custom fxrules. I've seen this post : http://weblogs.asp.net/rosherove/archive/2007/02/24/writing-real-unit-tests-for-your-custom-fxcop-rules.aspx but it's not working with the last version of fxcop. The Microsoft.Cci.Method.GetMethod doesn't exists and I can't find an alternative. Do you know how to g...

Testing time critical code

I've written a feature for my library Rubikon that displays a throbber (a spinning as you may have seen in other console apps) as long as some other code is running. To test this feature I capture the output of the throbber in a StringIO and compare it with the expected value. As the throbber is only displayed as long as the other code...

Migrate from MSTest to XUnit

We are thinking about moving our tests from MSTest to XUnit. Is there any migration application that takes a MSTest and migrates it to XUnit? Also, if not, what should I look out for when doing this? Thanks. JD. ...

Is there a problem-free way to run Scala 2.7.7 unit tests in Eclipse integrated nicely?

I'm developing Scala code using Eclipse, often when I run tests I get this error: No tests found with test runner 'JUnit 3'. Environment: Eclipse for Java Developers, 3.5.1 Scala 2.7.7 JUnit 4.7 I'm currently writing my tests as JUnit3 tests, and invoking them by right clicking on a package in the project explorer, choosing Run As ...

Debugging Silverlight and Silverlight Unit Tests

I am having trouble debugging silverlight, and the silverlight unit tests. Lets first talk about debugging silverlight. My silverlight project has the 'silverlight' debugger checked in the project properties so I don't really understand. Sometimes it will debug OK and I can put breakpoints in my view model classes, and other times not. ...

how to turn off a unit test in CPPUnit

I (finally) have my app being unit tested with CPPUnit and I have CruiseControl.NET running the tests and displaying the test output. I have several tests that always fail, however, so CruiseControl always marks the build as failed. Is there any way I can "turn off" or "skip" or "ignore" these always-failing tests? I'd rather not just...

How to copy an arbitrary file into a Visual Studio test run 'out' folder

I am trying to use a third party product secured with XHEO licensing and write unit tests against it. I can get the .lic file to copy to the regular project's bin directory (with either a post build or 'build action'), but the actual test itself doesnt seem to be running from there but from a constantly changing 'out' directory. A licen...

Help with TDD approach to a real world problem: linker

I'm trying to learn TDD. I've seen examples and discussions about how it's easy to TDD a coffee vending machine firmware from smallest possible functionality up. These examples are either primitive or very well thought-out, it's hard to tell right away. But here's a real world problem. Linker. A linker, at its simplest, reads one ob...

Putting array of arrays into a spring context

I just found a TestNG test case that uses Spring to provide its data source. As a result the code is quite clean and concise. However, I need to expand the test cases so they can take a variable list of inputs. Am I stuck using bean references for the list of lists as I've attempted below? Is there a way to do that and still be prett...

TFSBuild.Proj and Manual SQL Server Work Help?

Using the VS 2008 GDR update, I have created a database project. I have created a SQL Server deployment package. I have created a database unit test. Using some wizards, the stuff got into my tfsbuild.proj file so near the end of the automated build process a database is created. I lack a little control of the whole process, I now see....

What approach(es) have you used for lightweight Python unit-tests on App Engine?

I'm about to embark on some large Python-based App Engine projects, and I think I should check with Stack Overflow's "wisdom of crowds" before committing to a unit-testing strategy. I have an existing unit-testing framework (based on unittest with custom runners and extensions) that I want to use, so anything "heavy-weight"/"intrusive" ...

Which .net architecture should I implement for 10,000 concurrent users for web application

Hello experts, I need to create a web application for tasks delegation, monitor and generate reports for a organization. I am thinking about ASP.Net and MVC should be the architecture to support so many concurrent users. Is there any other better architecture that I should be looking for ? What kind of server configuration will requ...

Javascript: how to override public method in some class?

I have such JS class: SomeClass = function { // some stuff that uses initRequest this.initRequest = function() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } } ...

Which unit testing framework to use for C development on Windows?

On Windows XP, using TDM's GCC/MinGW32 for basic development i.e. gcc 4.4.x with gdb. Which unit testing framework to use for test driven development? Apparently Check's unit tests don't yet work on Windows. The questions at Unit Testing Frameworks for C and Unit Testing C Code are similar but not specifically about using gcc 4.4.x on ...

Assert function for Dialogue box

In my application there are 3 textboxes and a button. If a user doesnot fill any of these textboxes and hits the button, a message box is shown to user saying a particular textbox is not entered. Now how can I use Assert to confirm that message box was popped or not? Thanks for your answers in advance. ...

How to produce html unit test output in Python?

I'm looking for any way to display the results of python unit tests in an html summary. There are tools like this for Java and Ruby... haven't yet located any tools that seem to do this for Python. Are there any out there? JUnit html output: Ruby RSpec output: ...

iBatis.NET SqlMap.config file not found

I am using iBatis.NET in a very simple test project (VS 2008). When I run the suite and the Mapper is instantiated a FileNotFoundException pops up on opening SqlMap.config. The path where iBatis.NET looks for this file is "the current TestResults folder \ Out". Naturally, the file isn't copied there so the Mapper constructor fails. I mu...

Test modules with Test::Unit

I encountered a problem when trying to test a module with Test::Unit. What I used to do is this: my_module.rb: class MyModule def my_func 5 # return some value end end test_my_module.rb: require 'test/unit' require 'my_module' class TestMyModule < Unit::Test::TestCase include MyModule def test_my_func assert_equal(...

What is the right way to organize python unittests into suites?

I have some test case classes organized in directories foo_tests foo_tests1.py foo_tests2.py ... bar_tests bar_tests1.py ... The test cases look like: foo_tests1.py: import unittest class FooTestsOne(unittest.TestCase): def test_1(): assert(1=1) def test_2(): #... How do you organize test s...

Programmatic configuration of Enterprise Library logging block

I've previously used log4net, but my current employer uses Enterprise Library application blocks. I had previously developed unit tests for my core logging classes as follows and was wondering is someone knew the equivalent for the OneTimeSetup code below for the logging app block (sorry for the long code post): public abstract class D...