CustomZapViewTests.swift (990B)
1 // 2 // CustomZapViewTests.swift 3 // damusTests 4 // 5 // Created by Terry Yiu on 4/29/23. 6 // 7 8 import XCTest 9 @testable import damus 10 11 final class CustomZapViewTests: XCTestCase { 12 13 let enUsLocale = Locale(identifier: "en-US") 14 15 override func setUpWithError() throws { 16 // Put setup code here. This method is called before the invocation of each test method in the class. 17 } 18 19 override func tearDownWithError() throws { 20 // Put teardown code here. This method is called after the invocation of each test method in the class. 21 } 22 23 func testSatsString() throws { 24 XCTAssertEqual(satsString(0, locale: enUsLocale), "sats") 25 XCTAssertEqual(satsString(1, locale: enUsLocale), "sat") 26 XCTAssertEqual(satsString(2, locale: enUsLocale), "sats") 27 Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { 28 for count in 1...10 { 29 XCTAssertNoThrow(satsString(count, locale: $0)) 30 } 31 } 32 } 33 34 }