@@ -10,32 +10,72 @@ import XCTest
10
10
11
11
class PackageManifestBuilderTests : XCTestCase {
12
12
13
- let expected = """
14
- <contents of prefix>
15
- // MARK: - Dynamic Content
13
+ func testBuildWithDefaults( ) throws {
14
+ let expected = """
15
+ <contents of prefix>
16
+ // MARK: - Dynamic Content
16
17
17
- let clientRuntimeVersion: Version = " 1.2.3 "
18
- let crtVersion: Version = " 4.5.6 "
18
+ let clientRuntimeVersion: Version = " 1.2.3 "
19
+ let crtVersion: Version = " 4.5.6 "
19
20
20
- let excludeRuntimeUnitTests = false
21
+ let excludeRuntimeUnitTests = false
21
22
22
- let serviceTargets: [String] = [
23
- " A " ,
24
- " B " ,
25
- " C " ,
26
- " D " ,
27
- " E " ,
28
- ]
23
+ let isPreviewBuild = false
29
24
30
- <contents of base package>
31
- """
25
+ let serviceTargets: [String] = [
26
+ " A " ,
27
+ " B " ,
28
+ " C " ,
29
+ " D " ,
30
+ " E " ,
31
+ ]
32
32
33
- func testBuild( ) throws {
33
+ <contents of base package>
34
+ """
34
35
let subject = try PackageManifestBuilder (
35
36
clientRuntimeVersion: . init( " 1.2.3 " ) ,
36
37
crtVersion: . init( " 4.5.6 " ) ,
37
38
services: [ " A " , " B " , " C " , " D " , " E " ] . map { PackageManifestBuilder . Service ( name: $0) } ,
38
39
excludeRuntimeTests: false ,
40
+ previewBuild: false ,
41
+ prefixContents: { " <contents of prefix> " } ,
42
+ basePackageContents: { " <contents of base package> " }
43
+ )
44
+ let result = try ! subject. build ( )
45
+ print ( " " )
46
+ print ( result)
47
+ print ( " " )
48
+ XCTAssertEqual ( result, expected)
49
+ }
50
+
51
+ func testBuildWithPreviewBuildAndExcludedTests( ) throws {
52
+ let expected = """
53
+ <contents of prefix>
54
+ // MARK: - Dynamic Content
55
+
56
+ let clientRuntimeVersion: Version = " 1.2.3 "
57
+ let crtVersion: Version = " 4.5.6 "
58
+
59
+ let excludeRuntimeUnitTests = true
60
+
61
+ let isPreviewBuild = true
62
+
63
+ let serviceTargets: [String] = [
64
+ " A " ,
65
+ " B " ,
66
+ " C " ,
67
+ " D " ,
68
+ " E " ,
69
+ ]
70
+
71
+ <contents of base package>
72
+ """
73
+ let subject = try PackageManifestBuilder (
74
+ clientRuntimeVersion: . init( " 1.2.3 " ) ,
75
+ crtVersion: . init( " 4.5.6 " ) ,
76
+ services: [ " A " , " B " , " C " , " D " , " E " ] . map { PackageManifestBuilder . Service ( name: $0) } ,
77
+ excludeRuntimeTests: true ,
78
+ previewBuild: true ,
39
79
prefixContents: { " <contents of prefix> " } ,
40
80
basePackageContents: { " <contents of base package> " }
41
81
)
0 commit comments