質問編集履歴
1
やったこと
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,3 +7,95 @@
|
|
7
7
|
テストファイルを複数作成してやる方法を見つけることができませんでした。
|
8
8
|
|
9
9
|
参考になるような資料はありませんか?
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
UI/Unit Test Case Classを作成しました。
|
18
|
+
|
19
|
+
テストしたいクラスのインスタンス化をしようとするとエラーが出ます。
|
20
|
+
|
21
|
+
どのようにしたら改善するできるでしょうか?
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
```swift
|
28
|
+
|
29
|
+
import XCTest
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
class ConnectionManagementTest: XCTestCase {
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
override func setUp() {
|
38
|
+
|
39
|
+
super.setUp()
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
// In UI tests it is usually best to stop immediately when a failure occurs.
|
48
|
+
|
49
|
+
continueAfterFailure = false
|
50
|
+
|
51
|
+
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
|
52
|
+
|
53
|
+
XCUIApplication().launch()
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
override func tearDown() {
|
64
|
+
|
65
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
66
|
+
|
67
|
+
super.tearDown()
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
func testExample() {
|
74
|
+
|
75
|
+
// Use recording to get started writing UI tests.
|
76
|
+
|
77
|
+
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
func test(){
|
84
|
+
|
85
|
+
//ここでエラー 内容:Use of undeclared type 'ConnectionManagement'
|
86
|
+
|
87
|
+
let connectionManagement:ConnectionManagement
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
//ここでエラー 内容:Use of unresolved identifier 'ConnectionManagement
|
92
|
+
|
93
|
+
connectionManagement = ConnectionManagement.sharedConnectionManagement
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
```
|