Hello,
I have a test suite to perform smoke tests. I have all my script stored in various classes but when I try and run the test suite I can't seem to get it working if it is in a class. The code is below: (a class to call the tests)
from alltests import SmokeTests
class CallTests(SmokeTests):
def integration(self):
sel...
Hello all,
I've inherited a load of Junit test, but these tests (apart from most not working) are a mixture of actual unit test and integration tests (requiring external systems, db etc).
So I'm trying to think of a way to actually separate them out, so that I can run the unit test nice and quickly and the integration tests after that....
Hello, I've moved from one team to another in same company. In old team (hardcore c++) we did lots of unit testing. In my new team (also c++) they do functional testing instead. During review they reject my code because of unit tests. Most of the team is interested in learning something new but not the guy who is VIP and has legacy devel...
I manage a rather large application (50k+ lines of code) by myself, and it manages some rather critical business actions. To describe the program simple, I would say it's a fancy UI with the ability to display and change data from the database, and it's managing around 1,000 rental units, and about 3k tenants and all the finances.
When ...
I'm trying to set up a stub with Rhino Mocks which returns a value based on what the parameter of the argument that is passed in.
Example:
//Arrange
var car = new Car();
var provider= MockRepository.GenerateStub<IDataProvider>();
provider.Stub(
x => x.GetWheelsWithSize(Arg<int>.Is.Anything))
.Return(new List<IWheel> {
...
Ok, I know I am going out on a limb making a statement like that, so my question is for everyone to convince me I am wrong. Take this scenario:
I have method A, which calls method B, and they are in different layers.
So I unit test B, which delivers null as a result. So I test that null is returned, and the unit test passes. Nice.
The...
Suppose I have a C++ class like so:
class A
{
public:
A()
{
}
void SetNewB( const B& _b ) { m_B = _b; }
private:
B m_B;
}
In order to unit test something like this, I would have to break A's dependency on B. Since class A holds onto an actual object and not a pointer, I would have to ...
I have a set of unit tests, each with a bunch of methods, each of which produces output in the TestResults folder. At the moment, all the test files are jumbled up in this folder, but I'd like to bring some order to the chaos.
Ideally, I'd like to have a folder for each test method.
I know I can go round adding code to each test to mak...
My Sample Test Class:
namespace Test
{
[TestClass]
public class SampleTest
{
[TestMethod]
public void Test()
{
Assert.IsTrue(true); // <---------- LOOK
}
}
But if i do that:
namespace Test
{
[TestClass]
public class SampleTest
{
[TestMethod]
public void Test()
{
Assert.IsTrue(false); //...
Hi there, I'm trying to dive into the quite frankly terrible world of unit testing using Xcode (such a convoluted process it seems.)
Basically I have this test class, attempting to test my Show.h class
#import <GHUnit/GHUnit.h>
#import "Show.h"
@interface ShowTest : GHTestCase { }
@end
@implementation ShowTest
- (void)testShowCreate
{...
Does NSUserDefaults work in logic tests or only in/on simulator/hardware?
...
In NHibernate, there is a method doing something like ThisOrThat.VeryfyMappings() (I don't know the exact definition of it since it was a while ago I last tried NHibernate...)
I recall seeing a blog post somewhere where the author showed how to do some similar testing in Entity Framework 4, but now I cant find it. So, how do I test my E...
I've written a function to return the time_t value corresponding to midnight on a given day. When there is no midnight for a given day, it returns the earliest time available; that situation can occur, for example, when Egypt enters daylight-saving time. This year, the time change takes effect at midnight on the night of April 29, so the...
I need some guidance on how to use session objects with SQLAlchemy, and how to organize Unit Tests of my mapped objects.
What I would like to able to do is something like this:
thing = BigThing() # mapped object
child = thing.new_child() # create and return a related object
thing.save() # will also save the child object
In order to a...
As suggested by (among others) Kazi Manzur Rashid in this blog post, I am using ActionFilterAttributes to transfer model state from one request to another when redirecting.
However, I find myself unable to write a unit test that test the behavior of these attributes. As an example, this what I want the test for the ImportModelStateAttri...
I've got an application that requires the use of MyISAM on a few tables, but the rest are the traditional InnoDB type. The application itself is not concerned with transactions where it applies to these records, but performance is a concern.
The Rails testing environment assumes the engine used is transactional, though, so when the test...
Proxy configuration of a machine can be easily fetched using
def check_proxy():
import urllib2
http_proxy = urllib2.getproxies().get('http')
I need to write a test for the above written function. In order to do that I need to:-
Set the system-wide proxy to an
invalid URL during the test(sounds
like a bad idea).
Suppl...
I`m relatively new to the concept of unit-testing and have very little experience in the same. I have been looking at lots of articles on how to write unit-tests; however, I still have difficulty in writing tests where conditions like the following arise:-
Test user Input.
Test input read from a file.
Test input read from an environmen...
Part of my application depends on JavaMail, moving arranging messages etc. Is it possible to test this module without firing a IMAP server to run the tests on? I am always stuck when it comes to testing stuff that depends on external servers or modules.
...
Hi, I just started practicing TDD in my projects. I'm developing a project now using php/zend/mysql and phpunit/dbunit for testing. I'm just a bit distracted on the idea of encapsulation and the test driven approach. My idea behind encapsulation is to hide access to several object functionalities. To make it more clear, private and prote...