-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestBuilding.m
44 lines (32 loc) · 1.27 KB
/
TestBuilding.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// TestBuilding.m
// MathWars
//
// Created by Inf on 25.02.10.
// Copyright 2010 Soulteam. All rights reserved.
//
#import "Building.h"
#import "TestBuilding.h"
@implementation TestBuilding
-(void)createMapObject {
mapObject = [[Building alloc] init];
}
-(void)testEmptyObject {
[super testEmptyObject];
STAssertEquals(((Building*)mapObject).owner, mockPlayer, @"Строение должно сменить владельца");
}
-(void)testCombatWin {
[super testCombatWin];
STAssertEquals(((Building*)mapObject).owner, mockPlayer, @"Строение не должно менять владельца в случае победы");
}
-(void)testCombatLose {
[super testCombatLose];
STAssertEquals(((Building*)mapObject).owner, mockEnemy, @"Строение должно cменить владельца в случае победы");
}
-(void)testNilGuardian {
mapObject.guardian = mockPlayerUnit;
STAssertEquals(((Building*)mapObject).owner, mockPlayer, @"При смене стража владелец должен смениться на владельца стража");
mapObject.guardian = nil;
STAssertEquals(((Building*)mapObject).owner, mockPlayer, @"При уходе стража владелец должен остаться прежним");
}
@end