// // TestQuick.m // JSRunFramework // // Created by Jonathan Saggau on 9/3/06. // Copyright 2006 Jonathan Saggau. All rights reserved. // // This is the file where I put code while I'm developing. // Not really meant to be released, but might make a decent // Example of the main functionality of the framework #import #import "JSRun.h" #import "JSRunXmlParser.h" #import "NSNumberAdditions.h" #import "JSRunModel.h" @interface TestQuick : SenTestCase { } @end @implementation TestQuick - (void)setUp { //Make Data Structures Here. } - (void)tearDown { //Release data structures here. } - (void)testQuick { //NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:[@"~/Desktop/testIpodWorkout.xml" stringByExpandingTildeInPath]]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:[@"./xml/2006-08-31 01;38;35.xml" stringByStandardizingPath]]; //this works because we set the working path of oTool to our project path. NSLog(@"File = %@", fileURL); STAssertNotNil(fileURL, @"No File Found"); JSRunXmlParser *parser = [[JSRunXmlParser alloc] initWithContentsOfURL:fileURL]; [parser parse]; JSRunModel *run = [parser run]; NSLog(@"RUN = %@", run); NSLog(@"Testing predicate"); NSArray *allEvents = [run runEvents]; NSLog(@"All Events ::%@", allEvents); NSArray *filteredEvents = [run miSplits]; NSLog(@"Mile Splits %@", filteredEvents); NSLog(@" "); filteredEvents = [run splits]; NSLog(@"ALL Splits %@", filteredEvents); NSLog(@" "); NSLog(@"Distances = %@", [[run runDistanceHistory] distances]); NSLog(@"Distance Per snapshot = %@", [[run runDistanceHistory] distanceTraveledPerSnapshot]); NSLog(@"Attributes = %@", [[run runDistanceHistory] attributes]); STAssertEquals([[[run runDistanceHistory] distanceTraveledPerSnapshot] count], \ [[[run runDistanceHistory] distances] count] - 1, @"distanceTraveledPerSnapshot should be one shorter than Distances"); [fileURL release]; [parser release]; NSLog(@" "); } - (void)testLog { NSLog(@"TESTING"); } @end