|
From: Geisschaes <gei...@us...> - 2005-06-12 15:13:07
|
Update of /cvsroot/macattrick/macattrick/Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23353/Test Modified Files: HistoryManagerTest.h HistoryManagerTest.m Log Message: history management added Index: HistoryManagerTest.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/HistoryManagerTest.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HistoryManagerTest.h 10 Jun 2005 15:49:24 -0000 1.1 --- HistoryManagerTest.h 12 Jun 2005 15:12:50 -0000 1.2 *************** *** 34,36 **** --- 34,37 ---- } + @end Index: HistoryManagerTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/HistoryManagerTest.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HistoryManagerTest.m 10 Jun 2005 15:49:24 -0000 1.1 --- HistoryManagerTest.m 12 Jun 2005 15:12:50 -0000 1.2 *************** *** 28,32 **** #import "HistoryManagerTest.h" ! @implementation HistoryManagerTest --- 28,32 ---- #import "HistoryManagerTest.h" ! #import "Properties.h" @implementation HistoryManagerTest *************** *** 45,48 **** --- 45,67 ---- } + -(void) testRemoveDate { + NSFileManager *manager = [NSFileManager defaultManager]; + NSString *date = [[NSString alloc] initWithString: @"19990203"]; + NSString *dir = [[NSString alloc] initWithFormat:@"%@/%@", [Properties libraryPath], date]; + [manager createDirectoryAtPath:dir attributes:nil]; + NSString *file = [[NSString alloc] initWithFormat:@"%@/%@", dir, @"testfile"]; + NSData *contents = [[NSData alloc] init]; + [manager createFileAtPath: file contents: contents attributes:nil]; + UKTrue([manager fileExistsAtPath:file]); + UKTrue([manager fileExistsAtPath:dir]); + [historyManager removeDate:date]; + UKFalse([manager fileExistsAtPath:file]); + UKFalse([manager fileExistsAtPath:dir]); + + [dir release]; + [date release]; + [file release]; + [contents release]; + } |