Hi there,
I am interested in your opinions on unittesting code that uses Corba to communicate with a server.
Would you mock the Corba objects? In Python that's sort of a pain in the ass because all the methods of Corba objects are loaded dynamically. So you're basically stuck with "mock anything".
Thanks!
Note:
I believe I have not m...
When creating methods, should every object instantiated inside that method be passed in as a parameter so that those objects can be mocked in our unit tests?
We have a lot of methods here at work that have no associated unit tests and upon writing tests retrospectively; we find that there are quite a lot of objects instantiated inside t...
Using NUnit and NMock2 I was not able to compare what I thought were the same SqlParameters:
SqlParameter param1 = new SqlParameter("@Id", 1);
SqlParameter param2 = new SqlParameter("@Id", 1);
Assert.IsTrue(param1.Equals(param2)); // This failed
I stumbled across this problem, when trying to test an execution of a method using NMock2...
Hey,
I had to start writing some unit tests, using QualityTools.UnitTestFramework, for a web service layer we have developed, when my approach seemed to be incorrect from the beginning.
It seems that unit tests should be able to run in any order and not rely on other tests.
My initial thought was to have the something similar to the f...
I am using the mediator pattern to facilitate unit testing of GUI objects.
psudo code Example:
Class MyGuiClass
{
//... Declare and initialize mediator to be a MyMediator
private void On_SomeButtonPressed()
{
mediator.SomeButtonWasPressed();
}
}
Class MyMeditator
{
public void On_SomeButtonPressed()
{
//.. Do so...
I have a Singleton that is accessed in my class via a static property like this:OtherClassNotBeingTested.Instance.SomeInstanceMethod()
I would like to test my class with out making one of these objects. Is there a way for RhinoMocks to return a stub when the getter for the static property Instance is called?
To be clearer, here is the...
Hello all, first time poster.
I'm turning to my first question on stack overflow because I've found little resources in trying to find an answer. I'm looking to execute Selenium python tests from a C# application. I don't want to have to compile the C# Selenium tests each time; I want to take advantage of IronPython scripting for dyna...
So, I was trying out a test case on a website and Selenium registers the events perfectly. Now, if I have to search for a particular class and get the innerHTML of that class, how would I do it assuming that I am using Java as the driving language?
Just to be more clear. I have a class like this:
<h1 class="classname">.....</h1>
I...
The WCSF uses Model View Presenter (MVP) pattern for organizing/structuring the source code for a website. When MVP pattern is used correctly, it provides seperation of concerns, unit testability of presenter logic, etc.
How to make WCSF and CSLA framework play well (work together) for achieving unit testability of the presenter logic. ...
Here's the problem, I was assigned task from my bos to learn how to use Kohana and implement simple test in that. We would like to use it as our framework for future projects.
Being new to both KohanaPHP and SimpleTest, I can't figure it out how to do even the simplest test of my helpers. I can't even find a single step-by-step tutorial...
We have over 1000 unit tests. A while ago 18 of them started to fail when they were run together with the other tests. These tests run a windows workflow.
If they are run alone they pass.
The error appears to be that it cannot find the connection string.
It cannot find the connection string because it does not know which config file...
This is my problem test:
[Test]
public void PlayerHasPointsIncreasedOnEnterByFifteen() {
// Arrange.
var playerOneFake = new Mock<IEntity>();
playerOneFake.SetupGet(p => p.Score).Returns(0);
var pointState = new PointState(playerOneFake.Object);
// Act.
pointState.Enter();
...
I have a Private property that I want to access in my MS Test unit test.
// Make a local property for control so that we can mock the control object.
private Control localControl
{
get{return Control.Instance;}
}
I go to that unit, right click and select Create Private Accessor->MyUnitTestProject
The status ba...
After working with ASP.Net MVC, it has me thinking about Rails. I worked with Rails prior, but am a little rusty. ASP.Net MVC tutorials recomment hiding data layer implementation with the repository pattern. This allows easiesr Dependency Injection for Unit Testing, and nice decoupling of the controller from the model implementation. ...
My aim is to restore an Oracle database back to it's previous state after a lot of unit tests have been run by using flashback recovery using the ClassCleanup attribute.
I have written a batch file + SQL to properly restore the database. This has been tested in my command prompt numerous times without issues
I would normally put the re...
When I'm testing a void method there is nothing to assert.For example a CreateSomething method. I know I could call in the test method an other method like FindSomething,but anyway, if there is (in the create method) an error it will show up. So it's a good practice to call an assertion in every method or i'm fine sometimes without an as...
hi
I want to add two variables to my subclass which is inherited from unittest.testcase
like I have:
import unittest
class mrp_repair_test_case(unittest.TestCase):
def __init__(self, a=None, b=None, methodName=['runTest']):
unittest.TestCase.__init__(self)
self.a= a
self.b = b
def t...
I have a TestNG suite with large amount of methods. I execute this suite using wrapper built on top of TestNG runner. All tests in the suite fail except one. What should I write in testng.xml to execute just that one failed test?
Obvious solution is to assign unique group names to all of the methods and then specify name in testng.xml. ...
I am trying log some entries in a log file (Log.Trace / Log.Debug) while my VS unit test runs. I have also copied the file NLog.config to out directory through DeploymentItem attribute over class. Still my log file is not created. Any help as to how can we log entries in a file same as we do for normal web application.
...
I'm looking to build complex queries using the NHibernate Criteria API. I'd like to verify that the criteria is constructed as I would expect without having to actually run the query.
Is this possible? Are there any tips or techniques for doing it elegantly?
...