-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Foundation | ||
import XCTest | ||
|
||
class LprojFileTests: XCTestCase { | ||
var lprojFile: LprojFile! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
|
||
let path = NSFileManager.defaultManager().currentDirectoryPath.stringByAppendingPathComponent("DemoApp/Base.lproj") | ||
let URL = NSURL(fileURLWithPath: path)! | ||
lprojFile = LprojFile(URL: URL) | ||
} | ||
|
||
func testXibFiles() { | ||
XCTAssertEqual(lprojFile!.xibFiles.map({ $0.name }), ["LaunchScreen", "Main"]) | ||
} | ||
|
||
func testStringsFiles() { | ||
XCTAssertEqual(lprojFile!.stringsFiles.map({ $0.name }), ["Localizable"]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Foundation | ||
import XCTest | ||
|
||
class StringsFileTests: XCTestCase { | ||
var localizableStringsFile: StringsFile! | ||
var xibStringsFile: StringsFile! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
|
||
let directoryPath = NSFileManager.defaultManager().currentDirectoryPath.stringByAppendingPathComponent("DemoApp") | ||
let directoryURL = NSURL(fileURLWithPath: directoryPath)! | ||
localizableStringsFile = StringsFile(URL: directoryURL.URLByAppendingPathComponent("en.lproj/Localizable.strings")) | ||
xibStringsFile = StringsFile(URL: directoryURL.URLByAppendingPathComponent("en.lproj/Main.strings")) | ||
} | ||
|
||
func testUpdate() { | ||
xibStringsFile.updateValuesUsingLocalizableStringsFile(localizableStringsFile) | ||
|
||
XCTAssertEqual(xibStringsFile.dictionary["xUH-o8-DGc.text"]!, "Hello") | ||
XCTAssertEqual(xibStringsFile.dictionary["uZj-A7-ihc.normalTitle"]!, "Get started") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters