PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/Core/KSMemoryTicketStoreTest.m

http://macfuse.googlecode.com/
Objective C | 58 lines | 26 code | 12 blank | 20 comment | 0 complexity | 041e2b4792a970a00ddb20929d7589ab MD5 | raw file
 1// Copyright 2008 Google Inc.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#import <SenTestingKit/SenTestingKit.h>
16#import "KSTicketStoreTest.h"
17#import "KSMemoryTicketStore.h"
18
19
20// Most test methods are inherited from KSTicketStoreTest. This class overrides
21// setUp and tearDown to set the protected |store_| var to the correct subclass
22// to be tested.
23@interface KSMemoryTicketStoreTest : KSTicketStoreTest
24// Override to do nothing because KSMemoryTicketStore instances do not serialize
25// objects to disk at all, so encoding/decoding is never used (it defeats the 
26// purpose of the class).
27- (void)testEncodeDecode;
28@end
29
30
31@implementation KSMemoryTicketStoreTest
32
33- (void)setUp {
34  store_ = [[KSMemoryTicketStore alloc] initWithPath:nil];
35  [super setUp];
36}
37
38- (void)tearDown {
39  [store_ release];
40  store_ = nil;
41}
42
43- (void)testInitialization {
44  KSTicketStore *store = [[[KSMemoryTicketStore alloc] init] autorelease];
45  STAssertNotNil(store, nil);
46  
47  store = [KSMemoryTicketStore ticketStoreWithPath:nil];
48  STAssertNotNil(store, nil);
49  
50  store = [KSMemoryTicketStore ticketStoreWithPath:@"/tmp/foo"];
51  STAssertNil(store, nil);
52}
53
54- (void)testEncodeDecode {
55  // Override parent's imp to do nothing.
56}
57
58@end