unit-testing

Error when trying to create unit tests for wpf-project

Hello everybody, when i try to create unit tests using the unit test wizzard in visual studio 2008 the following error message is shown: "The following error was encountered while reading module 'PresentationFramework': Could not resolve member reference: System.Windows.Automation.Provider.IToggleProvider::get_ToggleState" I am able t...

Run xUnit tests from TFS2010

I'm trying to work out how to run xUnit tests from TFS 2010. I found some articles on how to achieve that with the older version (http://jonnekats.wordpress.com/2009/05/07/integrate-xunit-tests-into-your-daily-team-build/, http://weblogs.asp.net/mehfuzh/archive/2009/08/25/configuring-team-build-using-xunit.aspx). These approaches don't ...

Unit testing/How to assert a non-mocked method was called/C#/Rhino Mocks/NUnit

Hi, I have a MailService which permit me to send Email which implement the following Interface. public interface IMailService { bool SendRegisteringEmail(RegisterModel registerModel); bool SendMail(MailMessage mailMessage); MailMessage CreateRegisteringMailMessage(RegisterModel registerModel); IAppSettingsRepository ...

Zend_Test - Logging in and out different users for PHPUnit Testing

Hello A similar problem to mine is in this thread, but it doesn't use Zend_Session so is different from my issue. I have successfully got PHPUnit working using Zend Framework's ControllerTestCase class. I can log in a user and write successful tests for that log in, so that is fine: $this->request->setMethod('POST')->setPost(array('us...

How to get VS ASP.NET unit testing to work?

I'm trying to write a few test for an aspx page that handles posted xml. The project runs fine on the visual studio's web development server (WebDev.WebServer40) but when I try to run a basic (empty) test like the one bellow, the test run results show me this error: The host type 'ASP.NET' cannot be loaded for the following reason: The ...

Maven doesn't see tested classes

Hello, i have problem with maven. When i try to compile test classes (mvn test-compile), it fails to find the tested classes used in test classes. For example class UserTest can't be compiled because compiler can't find class User which is being used inside the UserTest class. The problem is most likely in the class path not including t...

How to create a mock object of a doctrine entity?

Hi, I'm trying to write a unit test with phpunit for a model that uses doctrine 2. I want to mock the doctrine entities but I really don't have a clue of how to do this. Can anyone explain to me how I need to do this? I'm using Zend Framework. The model that needs to be tested class Country extends App_Model { public function find...

How to use reflection to unit-test an internal (Friend in VB) class within an assembly, when the InternalsVisibleToAttribute is not an option?

I have a solution with two projects within: Company.Project.vbproj Company.Project.Tests.vbproj Within the Company.Project.vbproj assembly, I have a class FriendClass.vb which scope is Friend (internal in C#). Now I wish to test this FriendClass.vb from within the Company.Project.Tests.vbproj assembly. I know about the InternalsVisib...

Can't run Cocoa UnitTests because of Garbage Collector disabling

I'm trying to add some UnitTests to a bunch of Cocoa Legacy code. I created a Unit Test Bundle, and added all source and frameworks needed, but the build fails with this message: 2010-08-26 16:07:18.074 otest-x86_64[64675:903] The test bundle at /Users/giordano/application/build/Release/UnitTest.octest could not be loaded because its...

Is "Record" Deprecated in Rhino Mocks

The latest version of Rhino mocks supports Arrange, Act Assert methodology. Does that mean that the record method that it used in previous version is deprecated? I thought it was (deprecated), but as I was reading "The Art of Unit Testing" he uses the Record method when he introduces Rhino Mocks. So now I am not so sure.... Any one k...

Large amount of unit tests cause freezes with Failed Binder Transaction

Hello, I have about 400 unit tests that I have written for my Android application. If I run the tests package by package, everything works fine and all my tests pass. However, if I try to run them all at once, eventually (about 360 tests in), Android starts spitting out !!! Failed Binder Transaction Errors !!!. After about 10-20 of thes...

How to work as a "QA Engineer" on a project as opposed to a member of a "Test Driven Development Team" ?

Sincerest apologies if I'm asking this question in the wrong place. (possibly one of the mini-stack overflows specific to career advice and QA) I've spent a significant amount of time recently learning about and implementing unit testing frameworks for our projects. Prior to the introduction of a unit testing framework, our method was ...

Selenium, with Python, how to simplify scripts so that I can run them from other python scripts?

I'm having some trouble figuring out how to take out what is not necessary in a selenium strip and package it in such a way that I can call it from another script.. I am having trouble understanding what is going on with this, as I don't get where the unit testint parts are coming from... ideally if I could just separate this into a func...

phpunits for dummies (howto and documentation) ?

i would like to have a documentation on how to use phpunits for dummies. is there any ? or do you have a great reference website that provide how to use phpunits on daily basis ? ...

Is this an acceptable way to test MVVM-Light Toolkit Messages?

[TestMethod()] public void ShowSetup_SendsMessage_WhenShowSetupCommandCalled() { //Arrange Messenger.Reset(); MainViewModel target = new MainViewModel(); bool wasCalled = false; Messenger.Default.Register<NotificationMessage>(this,"Settings",(msg) => wasCalled = true); //Act ...

What is the difference between HSQLDB and JavaDB? Which one is suitable for unit testing?

Could you tell me the differences between HSQLDB and JavaDB? And which one should I use in unit testing, assuming that I only use standard features? Thanks. ...

Using Mockito, how do I intercept a callback object on a void method?

I'm using mockito to test a legacy JAAS/LDAP login module. The javax.security.auth.callback.CallbackHandler interface defines the function: void handle(javax.security.auth.callback.Callback[] callbacks) I'm expecting callbacks to contain a NameCallback, which is the object that needs to be manipulated to pass the test. Is there a wa...

PHP crash after executing code - Zend studio - Windows 7 64bits

Hi, I am using Zend Studio (7.2) to develop a PHP project. When I launch php script/unit test directly with Zend, my code is executed but PHP crash. By "crash" I mean windows opens a small message and says something like "CLI stop to works" (not exact message because I do not use a english version of windows). So this is not a problem t...

Is there any setting required to be done before unit testing a model that maps to a different table as compared to Rails convention?

I have a model Vehicle which actually maps to the at_vehicles table. So while running my test script for Vehicle, I get the error "'vehicles' relation does not exist". Is there a hack , that could allow me to run my tests with the current db schema as is? Thanks. ...

ViewResult returns no data

Hi! I am using the pattern from NerdDinner. I call Index() in my test Method and I the ViewREsult I get back has no data. So the variable data ends up being null. However, I know that there is data there. Because I can go to the watch window and expand the variable result and expand viewData->Model->ResultsView then I see the "expandi...