Skip to content

Commit

Permalink
Merge pull request #109 from SURYAKANTSHARMA/feature/iOS13SwiftUICombine
Browse files Browse the repository at this point in the history
Feature/ios15 swift UI combine
  • Loading branch information
SURYAKANTSHARMA authored Aug 20, 2023
2 parents 34e8d1e + 2a816b8 commit 0a9d0dd
Show file tree
Hide file tree
Showing 568 changed files with 6,309 additions and 35 deletions.
8 changes: 4 additions & 4 deletions CountryPicker/CountryPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
858BBE0125A7407B00DB5AE9 /* TableViewHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 858BBE0025A7407B00DB5AE9 /* TableViewHelpers.swift */; };
858BBE0925A81C8200DB5AE9 /* CountryPickerControllerWithSectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 858BBE0825A81C8200DB5AE9 /* CountryPickerControllerWithSectionTests.swift */; };
858BBE1125A81EC900DB5AE9 /* UIViewControllerHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 858BBE1025A81EC900DB5AE9 /* UIViewControllerHelpers.swift */; };
85DFED1C25A1A905000BB85C /* CountryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DFED1B25A1A905000BB85C /* CountryTests.swift */; };
85DFED3625A1C9B6000BB85C /* CountryCellTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DFED2E25A1C974000BB85C /* CountryCellTests.swift */; };
85DFED4625A2214A000BB85C /* CountryPickerViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DFED4525A2214A000BB85C /* CountryPickerViewTests.swift */; };
9657E56E2399167400B4B89B /* CountryPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9657E56D2399167300B4B89B /* CountryPickerView.swift */; };
Expand All @@ -26,6 +25,7 @@
9A4F58F520EF429C000CAFE5 /* CountryManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4F58EF20EF429C000CAFE5 /* CountryManager.swift */; };
9A4F58FE20EF42AA000CAFE5 /* CountryManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4F58FD20EF42AA000CAFE5 /* CountryManagerTests.swift */; };
9A4F590020EF42AA000CAFE5 /* CountryPicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0519E282054FDE500C77B45 /* CountryPicker.framework */; };
D87A146B2A86945A00EF17E1 /* CountryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87A146A2A86945A00EF17E1 /* CountryTests.swift */; };
E03F5FE22055163C00FA5B61 /* CountryPickerController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E03F5FDE2055163C00FA5B61 /* CountryPickerController.bundle */; };
E0519E2D2054FDE500C77B45 /* CountryPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E0519E2B2054FDE500C77B45 /* CountryPicker.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
Expand All @@ -48,7 +48,6 @@
858BBE0025A7407B00DB5AE9 /* TableViewHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewHelpers.swift; sourceTree = "<group>"; };
858BBE0825A81C8200DB5AE9 /* CountryPickerControllerWithSectionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryPickerControllerWithSectionTests.swift; sourceTree = "<group>"; };
858BBE1025A81EC900DB5AE9 /* UIViewControllerHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerHelpers.swift; sourceTree = "<group>"; };
85DFED1B25A1A905000BB85C /* CountryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryTests.swift; sourceTree = "<group>"; };
85DFED2E25A1C974000BB85C /* CountryCellTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCellTests.swift; sourceTree = "<group>"; };
85DFED4525A2214A000BB85C /* CountryPickerViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryPickerViewTests.swift; sourceTree = "<group>"; };
9657E56D2399167300B4B89B /* CountryPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryPickerView.swift; sourceTree = "<group>"; };
Expand All @@ -62,6 +61,7 @@
9A4F58FB20EF42AA000CAFE5 /* CountryPickerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CountryPickerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9A4F58FD20EF42AA000CAFE5 /* CountryManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryManagerTests.swift; sourceTree = "<group>"; };
9A4F58FF20EF42AA000CAFE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D87A146A2A86945A00EF17E1 /* CountryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CountryTests.swift; sourceTree = "<group>"; };
E03F5FDE2055163C00FA5B61 /* CountryPickerController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = CountryPickerController.bundle; sourceTree = "<group>"; };
E0519E282054FDE500C77B45 /* CountryPicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CountryPicker.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E0519E2B2054FDE500C77B45 /* CountryPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountryPicker.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -106,9 +106,9 @@
9A4F58FC20EF42AA000CAFE5 /* CountryPickerTests */ = {
isa = PBXGroup;
children = (
D87A146A2A86945A00EF17E1 /* CountryTests.swift */,
9A4F58FD20EF42AA000CAFE5 /* CountryManagerTests.swift */,
858BBE0025A7407B00DB5AE9 /* TableViewHelpers.swift */,
85DFED1B25A1A905000BB85C /* CountryTests.swift */,
85DFED2E25A1C974000BB85C /* CountryCellTests.swift */,
85DFED4525A2214A000BB85C /* CountryPickerViewTests.swift */,
858BBDD225A70F5100DB5AE9 /* CountryPickerEngineTests.swift */,
Expand Down Expand Up @@ -308,12 +308,12 @@
buildActionMask = 2147483647;
files = (
858BBE0125A7407B00DB5AE9 /* TableViewHelpers.swift in Sources */,
85DFED1C25A1A905000BB85C /* CountryTests.swift in Sources */,
858BBE0925A81C8200DB5AE9 /* CountryPickerControllerWithSectionTests.swift in Sources */,
85DFED3625A1C9B6000BB85C /* CountryCellTests.swift in Sources */,
858BBDC225A6D6AC00DB5AE9 /* CountryPickerControllerTests.swift in Sources */,
9A4F58FE20EF42AA000CAFE5 /* CountryManagerTests.swift in Sources */,
858BBE1125A81EC900DB5AE9 /* UIViewControllerHelpers.swift in Sources */,
D87A146B2A86945A00EF17E1 /* CountryTests.swift in Sources */,
858BBDDE25A7239B00DB5AE9 /* CountryPickerEngineTests.swift in Sources */,
85DFED4625A2214A000BB85C /* CountryPickerViewTests.swift in Sources */,
);
Expand Down
18 changes: 11 additions & 7 deletions CountryPicker/CountryPickerTests/CountryManagerTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CountryPickerTests.swift
// CountryPickerTests
// CountryManagerTests.swift
// CountryManagerTests
//
// Created by Mac mini on 7/6/18.
// Copyright © 2018 SuryaKant Sharma. All rights reserved.
Expand All @@ -9,11 +9,15 @@
import XCTest
@testable import CountryPicker

class CountryPickerTests: XCTestCase {
class CountryManagerTests: XCTestCase {
var countryManager: CountryManager!

var validCountryFilePath: String? {
let bundle = Bundle(for: CountryManager.self)
#if SWIFT_PACKAGE
let bundle = Bundle.module
#else
let bundle = Bundle(for: Country.self)
#endif
return bundle.path(forResource: "CountryPickerController.bundle/countries", ofType: "plist")
}

Expand Down Expand Up @@ -89,11 +93,11 @@ class CountryPickerTests: XCTestCase {
XCTAssertNil(countryManager.country(withDigitCode: "+3232"))
}

func test_countryLoading_withValidPath() {
func test_countryLoading_withValidPath() throws {
let urlPath = URL(fileURLWithPath: validCountryFilePath ?? "")
let countries = try? countryManager.fetchCountries(fromURLPath: urlPath)
let countries = try countryManager.fetchCountries(fromURLPath: urlPath)
XCTAssertNotNil(countries)
XCTAssertEqual(countries?.count, 250)
XCTAssertEqual(countries.count, 250)
}

func test_countryLoading_withInvalidPath() {
Expand Down
Loading

0 comments on commit 0a9d0dd

Please sign in to comment.