I'm using a twitter gem which basically accesses twitter and lets me grab tweets, timeline etc. Its really good but I have a lot of my code that uses the stuff it returns and I need to test it. The things the gem returns aren't exactly simple strings, there pretty complex objects (scary as well) so im left scratching my head.
So basica...
In TDD(Test Driven Development) development process, how to deal with the test data?
Assumption that a scenario, parse a log file to get the needed column. For a strong test, How do I prepare the test data? And is it properly for me locate such files to the test class files?
...
I've just signed up for the Google group entitled Test Driven Development but it's only had 3 posts in 2010 and seems to be littered with spam.
Does anyone know of a good TDD focussed place to ask those general perhaps 'subjective' questions which might not be welcomed on SO?
...
I'm trying to implement shoulda unit tests on a rails 2.3.5 app using mongomapper.
So far I've:
Configured a rails app that uses mongomapper (the app works)
Added shoulda to my gems, and installed it with rake gems:install
Added config.frameworks -= [ :active_record, :active_resource ] to config/environment.rb so ActiveRecord isn't us...
I have not used Unit Testing so far, and I intend to adopt this procedure. I was impressed by TDD and certainly want to give it a try - I'm almost sure it's the way to go.
Boost looks like a good choice, mainly because it's being maintained. With that said, how should I go about implementing a working and elegant file-structure and proj...
I'm trying to implement the strategy pattern using TDD. Each strategy item implements an interface. What's the best way to do this with TDD?
Do you have to create a test fixture for each implementation of the interface testing the same methods but on each implementation?
Any articles detailing the approach to take would be gratefully w...
Can someone provide a strategy/code samples/pointers to test Captcha validations + Authlogic using Shoulda, Factory Girl and Mocha?
For instance, my UsersController is something like:
class UsersController < ApplicationController
validates_captcha
...
def create
...
if captcha_validated?
# code to deal with user attributes
end
....
I'm currently looking into different options for unit testing Silverlight applications. One of the frameworks available is the Silverlight Unit Test Framework from Microsoft (developed primary by Jeff Wilcox, http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/).
One of the scenarios I'm looking into is running the same tests on both Silve...
My question is same as the title. I have not done Test driven development yet,I have performed unit testing and I am aware of testing in general but I hear it is much advantageous to follow TDD?. So should I opt for it everytime or are there some preconditions... i just need to know some basic or important requirements when i should opt ...
For TDD you have to
Create a test that fail
Do the simplest thing that could possible work to pass the test
Add more variants of the test and repeat
Refactor when a pattern emerge
With this approach you're supposing to cover all the cases ( that comes to my mind at least) but I'm wonder if am I being too strict here and if it is p...
Hi Guys
I have the following code that was written without Tests but is actually quite well designed and loosly coupled.
The CachedBindingListView constructs a number of objects namely the page provider and the Cache.
As Follows.
/// <summary>
/// Inner data cache
/// </summary>
private Cache<T> InnerCache { get; set; }...
I'm new to TDD approach so I'm wondering if anyone experienced wit this could enlighten me a little. I would like to get some leads how to use UML and TDD methodology together.
I've been used to: Design with UML --> Generate skeleton classes (and then keep it synchronized) -> Implement and finally Test. I must admit that testing part wa...
I'm interested in setting up a TDD environment for developing Vim scripts and rc files. As a simple example, say I want to have vim insert 8 spaces when I press the tab key. I would set up a script that did the following:
Launch vim using a sandboxed .vimrc file
press i
press tab
press esc
press :w test_out
assert that test_out contain...
Hello,
I'm using ADO.NET entity framework, and am using an AdventureWorks database attached to my local database server. For unit testing, what approaches have people taken to work with a database?
Obviously, the database has to be in a pre-defined state of change so that the tests can have some isolation from each other... so I need...
When you have a simple method, like for example sum(int x, int y), it is easy to write unit tests. You can check that method will sum correctly two sample integers, for example 2 + 3 should return 5, then you will check the same for some "extraordinary" numbers, for example negative values and zero. Each of these should be separate unit ...
I'm trying to make extensive tests for my new project but I have a problem.
Basically I want to test MyClass. MyClass makes use of several other class which I don't need/want to do their job for the purpose of the test. So I created mocks (I use gtest and gmock for testing)
But MyClass instantiate everything it needs in it's constructo...
I'm learning TDD, and I have a question about private / protected variables. My question is: If a function I want to test is operating on a private variable, how should I test it?
Here is the example I'm working with:
I have a class called Table that contains an instance variable called internalRepresentation that is a 2D array. I want...
I am embarking upon my first journey of test driven development in C#. To get started I'm using MSTest and Rhino.Mocks. I am attempting to write my first unit tests against my ICustomerRepository. It seems tedious to new up a Customer for each test method. In ruby-on-rails I'd create a seed file and load the customer for each test. It se...
It seems exceptionally heavy handed but going by the rule anything publicly available should be tested should auto-implemented properties be tested?
Customer Class
public class Customer
{
public string EmailAddr { get; set; }
}
Tested by
[TestClass]
public class CustomerTests : TestClassBase
{
[TestMethod]
public void Ca...
I am unit testing an ICustomerRepository interface used for retrieving objects of type Customer.
As a unit test what value am I gaining by testing the ICustomerRepository in this manner?
Under what conditions would the below test fail?
For tests of this nature is it advisable to do tests that I know should fail? i.e. look for id 4 when...