Skip to content

Commit

Permalink
Add test for TestMethodNameConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Jul 18, 2024
1 parent 86d040d commit 8890699
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/RevolutionKitTests/TestMethodNameConverterTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Testing
@testable import RevolutionKit

struct TestMethodNameConverterTests {
private static let fixtures = [
(true, "testDoSomething", "doSomething"),
(false, "testDoSomething", "testDoSomething"),
(true, "test_do_something", "do_something"),
(false, "test_do_something", "test_do_something"),
(true, "test", "test"),
(false, "test", "test"),
]

@Test("TestMethodNameConverter can convert method names", arguments: fixtures)
func testConversion(enableStripping: Bool, input: String, expected: String) {
let converter = TestMethodNameConverter(shouldStripPrefix: enableStripping)

let actual = converter.convert(input)
#expect(actual == expected)
}
}

0 comments on commit 8890699

Please sign in to comment.