diff --git a/Click2Minimize.xcodeproj/project.pbxproj b/Click2Minimize.xcodeproj/project.pbxproj index c7c8357..4d832f5 100644 --- a/Click2Minimize.xcodeproj/project.pbxproj +++ b/Click2Minimize.xcodeproj/project.pbxproj @@ -11,9 +11,12 @@ 21B199F72CFF981D00EA628D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21B199F62CFF981D00EA628D /* Assets.xcassets */; }; 21B19A052CFF9D1300EA628D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21B19A042CFF9D1300EA628D /* AppDelegate.swift */; }; 21E5E2E72D009E7E00B51E70 /* Accessibility.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21E5E2E62D009E7E00B51E70 /* Accessibility.framework */; }; + 4C78496369C7E9DA01BBE5E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD3303AF50B5EF026748D11 /* Foundation.framework */; }; + DF659CD5D1ADED2E1086E774 /* AppDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01890F857457595A2C2809C /* AppDelegateTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0AD3303AF50B5EF026748D11 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 21498BA72D00A20600EE1BF3 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 21B199EF2CFF981C00EA628D /* Click2Minimize.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Click2Minimize.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21B199F62CFF981D00EA628D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -21,9 +24,20 @@ 21B19A042CFF9D1300EA628D /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21B19A082D009C6E00EA628D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 21E5E2E62D009E7E00B51E70 /* Accessibility.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accessibility.framework; path = System/Library/Frameworks/Accessibility.framework; sourceTree = SDKROOT; }; + 243688FE1E02F1D0F0EBE349 /* Click2MinimizeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Click2MinimizeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F7B92659A5AC235BFF93EEB /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A01890F857457595A2C2809C /* AppDelegateTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AppDelegateTests.swift; path = Click2MinimizeTests/AppDelegateTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 1D4A0B516181770F78700CE9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C78496369C7E9DA01BBE5E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 21B199EC2CFF981C00EA628D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -41,6 +55,7 @@ 21B199F12CFF981C00EA628D /* Click2Minimize */, 21B199F02CFF981C00EA628D /* Products */, 21E5E2E52D009E7E00B51E70 /* Frameworks */, + B9D76728B7BDCAC7F6AB31DD /* Click2MinimizeTests */, ); sourceTree = ""; }; @@ -48,6 +63,7 @@ isa = PBXGroup; children = ( 21B199EF2CFF981C00EA628D /* Click2Minimize.app */, + 243688FE1E02F1D0F0EBE349 /* Click2MinimizeTests.xctest */, ); name = Products; sourceTree = ""; @@ -68,10 +84,29 @@ isa = PBXGroup; children = ( 21E5E2E62D009E7E00B51E70 /* Accessibility.framework */, + 8B379258814EA39E2E843142 /* OS X */, ); name = Frameworks; sourceTree = ""; }; + 8B379258814EA39E2E843142 /* OS X */ = { + isa = PBXGroup; + children = ( + 0AD3303AF50B5EF026748D11 /* Foundation.framework */, + ); + name = "OS X"; + sourceTree = ""; + }; + B9D76728B7BDCAC7F6AB31DD /* Click2MinimizeTests */ = { + isa = PBXGroup; + children = ( + A01890F857457595A2C2809C /* AppDelegateTests.swift */, + 5F7B92659A5AC235BFF93EEB /* Info.plist */, + ); + name = Click2MinimizeTests; + path = Click2MinimizeTests; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -92,6 +127,24 @@ productReference = 21B199EF2CFF981C00EA628D /* Click2Minimize.app */; productType = "com.apple.product-type.application"; }; + 86A29F0D01113DDD9A2AB4C5 /* Click2MinimizeTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4DFAF2136DBD712F9B426287 /* Build configuration list for PBXNativeTarget "Click2MinimizeTests" */; + buildPhases = ( + 1479D8CA281A3A887B833003 /* Sources */, + 1D4A0B516181770F78700CE9 /* Frameworks */, + FE99E012A9834E75A92D99C3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + DCF26CAE6CAD92B9C4995383 /* PBXTargetDependency */, + ); + name = Click2MinimizeTests; + productName = Click2MinimizeTests; + productReference = 243688FE1E02F1D0F0EBE349 /* Click2MinimizeTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -121,6 +174,7 @@ projectRoot = ""; targets = ( 21B199EE2CFF981C00EA628D /* Click2Minimize */, + 86A29F0D01113DDD9A2AB4C5 /* Click2MinimizeTests */, ); }; /* End PBXProject section */ @@ -134,9 +188,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FE99E012A9834E75A92D99C3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 1479D8CA281A3A887B833003 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DF659CD5D1ADED2E1086E774 /* AppDelegateTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 21B199EB2CFF981C00EA628D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -148,7 +217,25 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + DCF26CAE6CAD92B9C4995383 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 21B199EE2CFF981C00EA628D /* Click2Minimize */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ + 1542D87383873BFA44B61624 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = Click2MinimizeTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = com.hatimhtm.Click2MinimizeTests; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Click2Minimize.app/Contents/MacOS/Click2Minimize"; + }; + name = Release; + }; 21B199FC2CFF981D00EA628D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -335,6 +422,17 @@ }; name = Release; }; + 7677A7A0DEB315EE717C8ADA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = Click2MinimizeTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = com.hatimhtm.Click2MinimizeTests; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Click2Minimize.app/Contents/MacOS/Click2Minimize"; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -356,6 +454,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 4DFAF2136DBD712F9B426287 /* Build configuration list for PBXNativeTarget "Click2MinimizeTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1542D87383873BFA44B61624 /* Release */, + 7677A7A0DEB315EE717C8ADA /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 21B199E72CFF981C00EA628D /* Project object */; diff --git a/Click2Minimize.xcodeproj/xcshareddata/xcschemes/Click2Minimize.xcscheme b/Click2Minimize.xcodeproj/xcshareddata/xcschemes/Click2Minimize.xcscheme new file mode 100644 index 0000000..cb4dfc5 --- /dev/null +++ b/Click2Minimize.xcodeproj/xcshareddata/xcschemes/Click2Minimize.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Click2MinimizeTests/AppDelegateTests.swift b/Click2MinimizeTests/AppDelegateTests.swift new file mode 100644 index 0000000..02b2771 --- /dev/null +++ b/Click2MinimizeTests/AppDelegateTests.swift @@ -0,0 +1,29 @@ +import XCTest +@testable import Click2Minimize + +final class AppDelegateTests: XCTestCase { + var appDelegate: AppDelegate! + + override func setUp() { + super.setUp() + appDelegate = AppDelegate() + } + + override func tearDown() { + appDelegate = nil + super.tearDown() + } + + func testSetupAppDict() { + // Given + XCTAssertTrue(appDelegate.appDict.isEmpty, "appDict should be empty initially") + + // When + appDelegate.setupAppDict() + + // Then + XCTAssertEqual(appDelegate.appDict.count, 2, "appDict should contain exactly 2 items") + XCTAssertEqual(appDelegate.appDict["Visual Studio Code"], "Code", "Value for 'Visual Studio Code' should be 'Code'") + XCTAssertEqual(appDelegate.appDict["Rosetta Stone Learn Languages"], "Rosetta Stone", "Value for 'Rosetta Stone Learn Languages' should be 'Rosetta Stone'") + } +} diff --git a/Click2MinimizeTests/Info.plist b/Click2MinimizeTests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Click2MinimizeTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + +