unit-testing

How can I programatically test which CSS elements match my XHTML?

I have an application which generates XHTML documents which are styled with (mostly) static CSS. I'm currently using XPath and Hamcrest (Java) to verify that the documents are constructed correctly. However, I also need to verify that the correct CSS properties are matched. For example, I would like a test like this: Given XHTML element...

What block is not being tested in my test method? (VS08 Test Framework)

I have the following code: private void SetControlNumbers() { string controlString = ""; int numberLength = PersonNummer.Length; switch (numberLength) { case (10) : controlString = PersonNummer.Substring(6, 4); break; case (11) : ...

Is it possible to integrate NUnit to Visual Studio 2010?

When I create a MVC web application in Visual Studio 2010 it offers also to create a testing project using one of framework from the list. But I have only VS built-in testing framework in it. Is it possible to add NUnit there? ...

What are the Pros and Cons of Manual Unit Testing against the Automated Unit Testing?

Can I get the advantages and disadvantages of Manual Unit Testing compare to the Automated process. ...

How to deal with the test data in Junit?

In TDD(Test Driven Development) development process, how to deal with the test data? Assumption that a scenario, parse a log file to get the needed column. For a strong test, How do I prepare the test data? And is it properly for me locate such files to the test class files? ...

F# - specific agile tools

Possible Duplicate: F# development and unit testing? Are there any F# - specific agile software development tools? I'm thinking of things like a unit testing framework. ...

Learn to use Unit testing and Nunit application

Hi All I need to start using unit tests in my code . The problem is that i never written unit tests . Can you please recommend me some good sites and book how to write correctly unit tests and to use nunit application . Thanks a lot for help. ...

custom attribute changes in .NET 4

I recently upgraded a C# project from .NET 3.5 to .NET 4. I have a method that extracts all MSTest test methods from a given list of MethodBase instances. Its body looks like this: return null == methods || methods.Count() == 0 ? null : from method in methods let testAttribute = Attribute.GetCustomAttribute(method, ...

TestNG - Factories and Dataproviders

Background Story I'm working at a software firm developing a test automation framework to replace our old spaghetti tangled system. Since our system requires a login for almost everything we do, I decided it would be best to use @BeforeMethod, @DataProvider, and @Factory to setup my tests. However, I've run into some issues. Sample Te...

How do I get the name of the test method that was run in a testng tear down method?

Basically I have a tear down method that I want to log to the console which test was just run. How would I go about getting that string? I can get the class name, but I want the actual method that was just executed. Class testSomething() { @AfterMethod public void tearDown() { system.out.println('The test that just ran ...

Proper structure for many test cases in Python with unittest

I am looking into the unittest package, and I'm not sure of the proper way to structure my test cases when writing a lot of them for the same method. Say I have a fact function which calculates the factorial of a number; would this testing file be OK? import unittest class functions_tester(unittest.TestCase): def test_fact_1(self):...

Testing UI with MsTest

With NUnit, I could use NUnitForms to test the UI. It's massively cumbersome, but it gets the job done. Is there something similar for MsTest for the version shipping in VS2008? ...

Is there a way to distribute junit tests so they all get done faster?

Our JUnits take a total of 6 hours to run. Is there an easy way to run 1/n of them on n different machines? ...

Seeking recommendations on automated test framework for C

I'm writing some code (some of which uses W3C's libwww) in C. It's been a while since I've touched ANSI C. Back in the day we rolled our own test framework. Does anybody here have any test frameworks that they recommend for C programming? Googling around I was inclined to go with Check. It has a page on other unit testing frameworks in ...

Unit testing custom controls in Silverlight

I have several custom controls (some kind of frames for content and layout management, like wrap panel), and would like to write unit tests for them. It's hard to find any good examples except Silverlight control toolkit, which has some helper classes to do unit tests and it's quite complicated. For MVVM classes it's easy to write tests...

What's a good unit test framework for Common Lisp projects?

I need to write a unit test suite for a project I am developing in my spare time. Being a CL newbie I was overwhelmed by the amount of choices for a CL implementation, I spent quite some time to choose one. Now I am facing exactly the same thing with unit test frameworks. A quick glance at http://www.cliki.net/test%20framework shows 20 ...

C#: Use NUnit to test classes that use Nhibernate

I have a project with a lot of classes that use Nhibernate. Now I want to use NUnit to test those classes. Are there specific things I need to consider? ...

VS2008 web service code coverage

Hi, I have written a test method for a web service in VS2008, using visual studio test framework. Everything works fine until I enable code coverage for the web service dll in localtestrun.testrunconfig. Then, when I run the test, I get the result "Not executed". Could you give me an idea for this? Thank you ...

What are the advantages or difference in “assert False” and “self.assertFalse”

Hello, I am wrting test's and I have heard some people saying to use self.assertFalse rather than assert False. Why is this and are there any advantages to be had? Thanks ...

How can I effectively test a scripting engine?

I have been working on an ECMAScript implementation and I am currently working on polishing up the project. As a part of this, I have been writing tests like the following: [TestMethod] public void ArrayReduceTest() { var engine = new Engine(); var request = new ExecScriptRequest(@" var a = [1, 2, 3, 4, 5]; a.red...