|
14 | 14 |
|
15 | 15 | @testable import App |
16 | 16 |
|
17 | | -import XCTVapor |
| 17 | +import Testing |
18 | 18 |
|
19 | | -class LicenseTests: XCTestCase { |
20 | 19 |
|
21 | | - func test_init_from_dto() throws { |
22 | | - XCTAssertEqual(License(from: Github.Metadata.LicenseInfo(key: "mit")), .mit) |
23 | | - XCTAssertEqual(License(from: Github.Metadata.LicenseInfo(key: "agpl-3.0")), .agpl_3_0) |
24 | | - XCTAssertEqual(License(from: Github.Metadata.LicenseInfo(key: "other")), .other) |
25 | | - XCTAssertEqual(License(from: .none), .none) |
| 20 | +@Suite struct LicenseTests { |
| 21 | + |
| 22 | + @Test func init_from_dto() throws { |
| 23 | + #expect(License(from: Github.Metadata.LicenseInfo(key: "mit")) == .mit) |
| 24 | + #expect(License(from: Github.Metadata.LicenseInfo(key: "agpl-3.0")) == .agpl_3_0) |
| 25 | + #expect(License(from: Github.Metadata.LicenseInfo(key: "other")) == .other) |
| 26 | + #expect(License(from: .none) == .none) |
26 | 27 | } |
27 | 28 |
|
28 | | - func test_init_from_dto_unknown() throws { |
| 29 | + @Test func init_from_dto_unknown() throws { |
29 | 30 | // ensure unknown licenses are mapped to `.other` |
30 | | - XCTAssertEqual(License(from: Github.Metadata.LicenseInfo(key: "non-existing license")), .other) |
| 31 | + #expect(License(from: Github.Metadata.LicenseInfo(key: "non-existing license")) == .other) |
31 | 32 | } |
32 | 33 |
|
33 | | - func test_fullName() throws { |
34 | | - XCTAssertEqual(License.mit.fullName, "MIT License") |
35 | | - XCTAssertEqual(License.agpl_3_0.fullName, "GNU Affero General Public License v3.0") |
36 | | - XCTAssertEqual(License.other.fullName, "Unknown or Unrecognised License") |
37 | | - XCTAssertEqual(License.none.fullName, "No License") |
| 34 | + @Test func fullName() throws { |
| 35 | + #expect(License.mit.fullName == "MIT License") |
| 36 | + #expect(License.agpl_3_0.fullName == "GNU Affero General Public License v3.0") |
| 37 | + #expect(License.other.fullName == "Unknown or Unrecognised License") |
| 38 | + #expect(License.none.fullName == "No License") |
38 | 39 | } |
39 | 40 |
|
40 | | - func test_shortName() throws { |
41 | | - XCTAssertEqual(License.mit.shortName, "MIT") |
42 | | - XCTAssertEqual(License.agpl_3_0.shortName, "AGPL 3.0") |
43 | | - XCTAssertEqual(License.other.shortName, "Unknown license") |
44 | | - XCTAssertEqual(License.none.shortName, "No license") |
| 41 | + @Test func shortName() throws { |
| 42 | + #expect(License.mit.shortName == "MIT") |
| 43 | + #expect(License.agpl_3_0.shortName == "AGPL 3.0") |
| 44 | + #expect(License.other.shortName == "Unknown license") |
| 45 | + #expect(License.none.shortName == "No license") |
45 | 46 | } |
46 | 47 |
|
47 | | - func test_isCompatibleWithAppStore() throws { |
48 | | - XCTAssertEqual(License.mit.licenseKind, .compatibleWithAppStore) |
49 | | - XCTAssertEqual(License.agpl_3_0.licenseKind, .incompatibleWithAppStore) |
50 | | - XCTAssertEqual(License.other.licenseKind, .other) |
51 | | - XCTAssertEqual(License.none.licenseKind, .none) |
| 48 | + @Test func isCompatibleWithAppStore() throws { |
| 49 | + #expect(License.mit.licenseKind == .compatibleWithAppStore) |
| 50 | + #expect(License.agpl_3_0.licenseKind == .incompatibleWithAppStore) |
| 51 | + #expect(License.other.licenseKind == .other) |
| 52 | + #expect(License.none.licenseKind == .none) |
52 | 53 | } |
53 | 54 |
|
54 | 55 | } |
0 commit comments