-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add categories for places nearby Co-authored-by: Daniel W. Steinbrook <[email protected]>
- Loading branch information
Showing
8 changed files
with
199 additions
and
12 deletions.
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
Binary file modified
BIN
+92 Bytes
(100%)
apps/ios/GuideDogs/Assets/Localization/en-GB.lproj/Localizable.strings
Binary file not shown.
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
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
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
63 changes: 63 additions & 0 deletions
63
apps/ios/UnitTests/Data/Destination Manager/NearbyTableFilterTest.swift
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,63 @@ | ||
// | ||
// NearbyTableFilterTest.swift | ||
// UnitTests | ||
// | ||
// Created by Jonathan Ha on 7/11/24. | ||
// Copyright © 2024 Soundscape community. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import Soundscape | ||
|
||
final class NearbyTableFilterTest: XCTestCase { | ||
|
||
override func setUpWithError() throws { | ||
continueAfterFailure = false | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
} | ||
|
||
func testDefaultFilter() throws { | ||
let filter = NearbyTableFilter.defaultFilter | ||
XCTAssertNil(filter.type) | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.all")) | ||
XCTAssertEqual(filter.image, UIImage(named: "AllPlaces")) | ||
} | ||
|
||
func testPrimaryTypeFilters() throws { | ||
let filters = NearbyTableFilter.primaryTypeFilters | ||
XCTAssertEqual(filters.count, PrimaryType.allCases.count + 1) // +1 for the default filter | ||
|
||
for (index, type) in PrimaryType.allCases.enumerated() { | ||
let filter = filters[index + 1] // First filter is the default filter | ||
XCTAssertEqual(filter.type, type) | ||
switch type { | ||
case .transit: | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.transit")) | ||
XCTAssertEqual(filter.image, UIImage(named: "Transit")) | ||
case .food: | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.food_drink")) | ||
XCTAssertEqual(filter.image, UIImage(named: "Food & Drink")) | ||
case .park: | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.parks")) | ||
XCTAssertEqual(filter.image, UIImage(named: "Parks")) | ||
case .bank: | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.banks")) | ||
XCTAssertEqual(filter.image, UIImage(named: "Banks & ATMs")) | ||
case .grocery: | ||
XCTAssertEqual(filter.localizedString, GDLocalizedString("filter.groceries")) | ||
XCTAssertEqual(filter.image, UIImage(named: "Groceries & Convenience Stores ")) | ||
} | ||
} | ||
} | ||
|
||
func testEquality() throws { | ||
let filter1 = NearbyTableFilter(type: .transit) | ||
let filter2 = NearbyTableFilter(type: .transit) | ||
let filter3 = NearbyTableFilter(type: .food) | ||
|
||
XCTAssertEqual(filter1, filter2) | ||
XCTAssertNotEqual(filter1, filter3) | ||
} | ||
} |