I updated imSimReal again. This time I only added a new test case, so I didn’t roll to a new Release Candidate. If you’re interested, you’ll have to get the latest from github.
In short, I added the test case - (void)testGetGravityForSelectedBodyWithBadBodyName:. The primary plan here was to make sure that we can deal with the case where the selectedBody in IMSRGravity is not a member of the bodyGravity NSDictionary.
A look at the test:
- (void)testGetGravityForSelectedBodyWithBadBodyName
{
NSString *body = @"test";
IMSRGravity *gravity = [[IMSRGravity alloc] init];
STAssertNotNil(gravity, @"IMSRGravity not created with default initializer");
[gravity setSelectedBody: body];
double expectedResult = 0.0; // value if selectedBody is not valid (i.e., null, etc.)
double result = [gravity gravityForSelectedBody];
STAssertEquals(result, expectedResult, @"Expected %f, got %f", expectedResult, result);
[body release];
[gravity release];
}
Technorati Tags:
Development, imSimReal
There are no comments yet...Kick things off by filling out the form below.