I am using NUnit asserts within a MSTest project like as follows (NOTE: This shouldn't matter see comments to Dave Falkner's answer):
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSTestExtensions;
using Assert = NUnit.Framework.Assert;
using Is = NUnit.Framework.Is;
This has worked great in my unit tests, but in my integr...
I'm teaching a data structures class this semester and we build gobs of JUnit tests given component interfaces. We then use setUp to plug in a specific concrete implementation. In most cases we are implementing java.util interfaces. Is there a common set of rigorous JUnit tests for common Java components, or some sort of framework tha...
In every version of JUnit I have tried (up to 4.8.1), a failing assertThat will display an error message that looks like:
expected: [describeTo]
got: [String representation of object]
In other words, it will display the toString() of the object instead of the mismatch description from the Matcher. If I use the assertThat from org.hamc...
I'm using Reactive Extensions for .NET (Rx) to expose events as IObservable<T>. I want to create an unit test where I assert that a particular event is fired. Here is a simplified version of the class I want to test:
public sealed class ClassUnderTest : IDisposable {
Subject<Unit> subject = new Subject<Unit>();
public IObservable<...
Hi,
I'm using nose test framework. When running a test module, the teardown function defined in it failed. the error raised says the fixture is locked by another process. here is my test module, test_my_module.py:
... ...
def teardown():
if os.path.exists(test_output_dir):
shutil.rmtree(test_output_dir)
... ...
@with_s...
I am looking for ways to run test suites in parallel.
I am aware of .testrunconfig setting. This allows you to multiplex on the number of CPUs.
I want to run 1000 tests in parallel. This makes sense because I am testing a web service, so 90% of the time spent in a test is waiting for the service to respond.
Any ideeas on how to p...
I'm trying to test the happy-path for a piece of code which takes a long time to respond, and then begins writing a file to the response output stream, which prompts a download dialog in browsers.
The problem is that this process has failed in the past, throwing an exception after this long amount of work. Is there a way in selenium to ...
I would like a JUnit 4 test class to implement the same interface as the class its testing. This way, as the interface changes (and it will, we're in early development), the compiler guarantees that corresponding methods are added to the test class. For example:
public interface Service {
public String getFoo();
public String getB...
Is it possible to mark a test as "expected to fail" with PHPUnit? This would be useful when performing TDD, and you want to distinguish between genuinely failed tests, and tests that happen to fail because the associated code hasn't been written yet.
...
I have the following repository that I use for unit testing:
public class MyTestRepository<T>
{
private List<T> entities = new List<T>();
public IQueryable<T> Entities
{
get { return entities.AsQueryable(); }
}
public T New()
{
//return what here???
}
public void Create(T entity)
{
...
Can I test Javascript code in GWO? For example, how would I test:
$('#first_name_field').watermark('First name');
Ideally the person who tests different content doesn't have to enter lots of javascript, only the text they want to change... like "First name" above.
...
I have file something like this
1111,K1
2222,L2
3333,LT50
4444,K2
1111,LT50
5555,IA
6666,NA
1111,NA
2222,LT10
Output that is need
1111,K1,LT50,NA
2222,L2,LT10
3333,LT50
4444,K2
5555,IA
6666,NA
1 st Column number may repeat anytime but output that i need is sort and uniq
...
Hey everybody,
I am trying to write a unit testing for a User model in Ruby on Rails. I am using authlogic and need to check that the first_name and last_name of the user model attributes are not the same when the user is registering.
This is my user model:
class User < ActiveRecord::Base
acts_as_authentic do |c|
c.login_field= ...
Is it ok to have integration tests and unit tests in one assembly (project) ? Or rather have them separate ?
...
Please explain the meaning of the marked red section in the screenshot below.
All helps are very much appreciated!
...
Hi,
does anybody know how could I skip the console output generated by maven (surefire) tests?
I want to execute the tests and see how many of them passed and failed but skip the console output of the execution of these tests.
thank you!
...
Where can I find good literature on unit testing? Book titles and links are welcome.
...
I have a rather large set of integration tests developed in C#/NUnit. Currently it is one test fixture, one class. In [TestFixtureSetUp] I create a database from a script and populate it with test data, also from a script. My tests do not modify data, so they can run in any order or in parallel.
My problem is that I have too many tests...
Hi all,
I'm new in android testing. All I've used in the testing is only the ActivityInstrumentationTestCase2 (AITC2) which is explained in the Hello, Testing tutorial.
I've made a test class using AITC2 and it runs well. But once I changed the base test class to SingleLaunchActivityTestCase (SLATC) I got RuntimeException specifying "U...
I recently got aboard the Pex & Moles bandwagon in order to test some logic with many elements that are static, non-virtual, sealed, etc. Recently, I've begun to see behavior I can't explain from a few of the tests.
A couple of the methods for an interface I stubbed out return void, so I set the stubs to delegates that update boolean v...