Hi,
I've got an ASP.NET MVC 2 Web app in VS 2010 and decided to try using MS unit testing stuff. What do you know, on the first test I created it gives me grief and refuses to elaborate.
I have created a single test class and a single test method. I am using Moq to create a HttpContext (including Request, Response, Session, QueryString...
Hello guys, I want to know if anyone of you guys use TDD in your c++ projects and how it performs compared to managed languages like C# and Java.
And what frameworks you guys are using to automate tests on c++ projects?
...
Well, Maven is too good, when talking about speed.
But I want something that is more acceptable.
Imagine I wrote a test org.fun.AbcTestCase
In such TestCase, I include some JUnit / TestNG tests
Now I want to run only this test case, said org.fun.AbcTestCase from command line.
How can I do that?
I know it's easy to do it within Eclipse o...
I am new to testing in Xcode. I am following the developer documentation "iOS Developement Guide" Unit Testing Applications.
I have successfully added unit test bundles to my application with one failing test.
When I build the test target the output shows 1 error as expected but the editor does not show the expected error message unde...
I want to make some unittests for my app, and I need to compare two arrays. Since array.__eq__ returns a new array (so TestCase.assertEqual fails), what is the best way to assert for equality?
Currently I'm using
self.assertTrue((arr1 == arr2).all())
but I don't really like it :\
...
I have read many posts about setting up unit testing in Zend Framework and I simply have not been able to get even one simple unit test to run. The issue is with setting up and testing the bootstrap environment. I tried the simplest of ways using the ZFW docs, but I always get this error:
Zend_Config_Exception: parse_ini_file(/usr/l...
How do I test which view was rendered from a controller action if what I get is a T4MVC_ActionResult? Under normal circumstances I should be able to directly use TestHelper's methods, like in the examples:
pooController.Details().AssertViewRendered().ForView("Details")
...but, since through T4MVC I get a T4MVC_ActionResult instead of ...
I am trying to test for an exception.
I have:
def test_set_catch_status_exception(self):
mro = self.mro
NEW_STATUS = 'No such status'
self.assertRaises(ValueError,mro.setStatus(NEW_STATUS))
I get the following error:
======================================================================
ERROR: test_set_catch_status_excep...
So we have a unit test which is failing where we attempt to call the save method on a model. This for some reason returns true when we run the method in reality. We've mocked the domain in the setUp method.
Does anyone know why the heck the save method is returning null?
Source Code here: http://gist.github.com/485365
We're running Gr...
I am looking for some tutorials and guides for unit testing on SAP platform.
So far, I have found some mention of ABAP Unit and of Ruby programming language being implemented on SAP platform, making it much more interesting option for unit testing SAP. However, the information is quite scarce and I would appreciate some help on the subj...
I've recently upgraded to NUnit 2.5 (yeah I know) and I was wondering if I could pick someone's brain with this.
I have lots of tests that look like this:
[Test]
public void TestTheSpecialDict() {
int start = 0;
int end = 44;
Dictionary<int, string> = SomeFunction(start, end);
Assert.That(dict1.Count > 0);
// Alr...
I want to create a stub of one of my Activities, but I want to keep it in the test project so not to have it in the actual apk. I don't seem to be able to find a way to do it though. I get this:
java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.test.StubA...
I'm working on an existing JEE project with various maven modules that are developed in Eclipse, bundled together and deployed on JBoss using Java 1.6. I have the opportunity to prepare any framework and document how unit testing should be brought to the project.
Can you offer any advice on...
JUnit is where I expect to start, is this...
I'm trying to integrate database unit tests into the build process (Visual Studio 2005, TFS, VS for Database Professionals, MS SQL Server 2005). The build is running on a dedicated build server. When the tests (that work perfectly locally) start running on the server, I get a "login failed" error because the database password I save in T...
I'm trying to write a unit test for a class that generates distinct strings. My initial reaction was the following:
public void GeneratedStringsShouldBeDistinct()
{
UniqueStringCreator stringCreator = new UniqueStringCreator();
HashSet<string> generatedStrings = new HashSet<string>();
string str;
for (int i = 0; i < 10...
I've been thinking about creating a Java framework that would allow programmers to specify invariants (pre- and post-conditions) on interfaces. The purpose would be to make code more robust and reduce the number of unit tests that would need to be written for different implementations of the same interface.
I envisage creating some way ...
Hello,
I am writing some unit tests for an MVC controller which requires a call to ObjectFactory.GetNamedInstance. The code looks as follows
ObjectFactory.GetNamedInstance("BuyerMembershipProvider")
I am aware of the ObjectFactory.inject method to Inject a stub of the desired type, however it does not seem to work for getnamedinsta...
I'm working on some test cases at the moment, and I'm regularly finding that I'm ending up with multiple asserts in each case. For example (over-simplified and comments stripped for brevity):
[Test]
public void TestNamePropertyCorrectlySetOnInstantiation()
{
MyClass myInstance = new MyClass("Test name");
Assert.AreEqual("Test Name",...
Hi everyone,
I have a MOSS2007 application and now I want to unit test on the application?
There is any way to do that?
Thanks
...
On a related note to this question, which just came up:
I commonly follow the naming convention LibraryClass <-> LibraryClassTests for my unit tests. However, when renaming LibraryClass using the default rename/refactor functionality in either Visual Studio, R# or CodeRush (I have tested both) the test file is not renamed, meaning I mig...