Skip to content

Commit

Permalink
Add sourcery config and mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
GianniCarlo committed Jun 4, 2023
1 parent 9270ee9 commit 62076a0
Show file tree
Hide file tree
Showing 28 changed files with 1,798 additions and 527 deletions.
10 changes: 10 additions & 0 deletions .sourcery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sources:
- ./Shared
- ./BookPlayerKit
- ./BookPlayer
templates:
- Templates
output: BookPlayer/Generated
args:
autoMockableImports: ["Combine", "BookPlayerKit"]
autoMockableTestableImports: ["BookPlayer"]
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
excluded:
- Carthage
- BookPlayer/Generated/AutoMockable.generated.swift
cyclomatic_complexity:
ignores_case_statements: true
# line_length: 120
Expand Down
28 changes: 4 additions & 24 deletions BookPlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
62793611272CBE910097837D /* ImportFileItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4163E3102148606600072AA2 /* ImportFileItem.swift */; };
6279361F272D0D110097837D /* MainCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6279361E272D0D110097837D /* MainCoordinatorTests.swift */; };
62AAE2252749283F001EB9FF /* MiniPlayerViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62AAE2242749283F001EB9FF /* MiniPlayerViewModelTests.swift */; };
62AAE22727492896001EB9FF /* PlayerManagerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62AAE22627492896001EB9FF /* PlayerManagerMock.swift */; };
62AAE22D274AA6DE001EB9FF /* LibraryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62AAE22B274AA3EB001EB9FF /* LibraryService.swift */; };
62AAE22E274AA6DE001EB9FF /* LibraryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62AAE22B274AA3EB001EB9FF /* LibraryService.swift */; };
62AAE231274ABB5D001EB9FF /* LibraryServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62AAE230274ABB5D001EB9FF /* LibraryServiceTests.swift */; };
Expand Down Expand Up @@ -401,6 +400,7 @@
9F7B647A2804773D00895ECC /* ThemesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7B64792804773D00895ECC /* ThemesViewModel.swift */; };
9F7B647C2804798800895ECC /* IconsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7B647B2804798800895ECC /* IconsViewModel.swift */; };
9F7B647E2804916900895ECC /* PlusViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7B647D2804916900895ECC /* PlusViewModel.swift */; };
9F7C47532A2C15D300F9A500 /* AutoMockable.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7C47522A2C15D300F9A500 /* AutoMockable.generated.swift */; };
9F82DF6927DE93A2001B0EA8 /* SkipIntervalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82DF6827DE93A2001B0EA8 /* SkipIntervalView.swift */; };
9F82DF6B27DE9792001B0EA8 /* NowPlayingMediaControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82DF6A27DE9792001B0EA8 /* NowPlayingMediaControlsView.swift */; };
9F82DF6D27DE985A001B0EA8 /* NowPlayingPlaybackControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82DF6C27DE985A001B0EA8 /* NowPlayingPlaybackControlsView.swift */; };
Expand Down Expand Up @@ -437,9 +437,6 @@
9FB20EB729A423410021663B /* InterfaceUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB20EB629A423410021663B /* InterfaceUpdater.swift */; };
9FB20EB929A479FB0021663B /* BPAlertContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB20EB829A479FB0021663B /* BPAlertContent.swift */; };
9FB7C48D2835A2C1003B917E /* PlayerManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C48C2835A2C1003B917E /* PlayerManagerTests.swift */; };
9FB7C48F2835A4C9003B917E /* EmptyLibraryServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C48E2835A4C9003B917E /* EmptyLibraryServiceMock.swift */; };
9FB7C4912835A5A3003B917E /* EmptyPlaybackServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C4902835A5A3003B917E /* EmptyPlaybackServiceMock.swift */; };
9FB7C4932835A617003B917E /* EmptySpeedServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C4922835A617003B917E /* EmptySpeedServiceMock.swift */; };
9FBDBC792879409600D315A2 /* SyncableItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBDBC782879409600D315A2 /* SyncableItem.swift */; };
9FBDBC7D287940D900D315A2 /* ContentsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBDBC7C287940D900D315A2 /* ContentsResponse.swift */; };
9FBDBC7E287940D900D315A2 /* ContentsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBDBC7C287940D900D315A2 /* ContentsResponse.swift */; };
Expand All @@ -465,15 +462,13 @@
9FC1E45F2814F66F00522FA8 /* AccountAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E45E2814F66F00522FA8 /* AccountAPI.swift */; };
9FC1E4602814F66F00522FA8 /* AccountAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E45E2814F66F00522FA8 /* AccountAPI.swift */; };
9FC1E4632814F80000522FA8 /* AccountServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E4622814F80000522FA8 /* AccountServiceMock.swift */; };
9FC1E465281507BD00522FA8 /* SyncServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E464281507BD00522FA8 /* SyncServiceMock.swift */; };
9FC1E4672815091A00522FA8 /* AccountServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E4662815091A00522FA8 /* AccountServiceTests.swift */; };
9FC1E46928150ECC00522FA8 /* NetworkClientMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E46828150ECC00522FA8 /* NetworkClientMock.swift */; };
9FC1E46C2815A8CA00522FA8 /* LibraryAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E46A2815A8A800522FA8 /* LibraryAPI.swift */; };
9FC1E46D2815A8CA00522FA8 /* LibraryAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E46A2815A8A800522FA8 /* LibraryAPI.swift */; };
9FC1E4772815F97E00522FA8 /* KeychainServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E4762815F97E00522FA8 /* KeychainServiceTests.swift */; };
9FC1E4782816001400522FA8 /* KeychainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E4742815C6A300522FA8 /* KeychainService.swift */; };
9FC1E4792816001400522FA8 /* KeychainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E4742815C6A300522FA8 /* KeychainService.swift */; };
9FC1E47B281600D500522FA8 /* KeychainServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC1E47A281600D500522FA8 /* KeychainServiceMock.swift */; };
9FCC228C2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 9FCC228B2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel */; };
9FCC228D2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 9FCC228B2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel */; };
9FCC228E2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 9FCC228B2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel */; };
Expand Down Expand Up @@ -967,7 +962,6 @@
624EB9832755D8E700D462A8 /* Audiobook Player 8.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Audiobook Player 8.xcdatamodel"; sourceTree = "<group>"; };
6279361E272D0D110097837D /* MainCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinatorTests.swift; sourceTree = "<group>"; };
62AAE2242749283F001EB9FF /* MiniPlayerViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiniPlayerViewModelTests.swift; sourceTree = "<group>"; };
62AAE22627492896001EB9FF /* PlayerManagerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerManagerMock.swift; sourceTree = "<group>"; };
62AAE22B274AA3EB001EB9FF /* LibraryService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryService.swift; sourceTree = "<group>"; };
62AAE230274ABB5D001EB9FF /* LibraryServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryServiceTests.swift; sourceTree = "<group>"; };
62CADB8D2724E41800A4A98F /* Audiobook Player 7.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Audiobook Player 7.xcdatamodel"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1054,6 +1048,7 @@
9F7B64792804773D00895ECC /* ThemesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemesViewModel.swift; sourceTree = "<group>"; };
9F7B647B2804798800895ECC /* IconsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconsViewModel.swift; sourceTree = "<group>"; };
9F7B647D2804916900895ECC /* PlusViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusViewModel.swift; sourceTree = "<group>"; };
9F7C47522A2C15D300F9A500 /* AutoMockable.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AutoMockable.generated.swift; path = BookPlayer/Generated/AutoMockable.generated.swift; sourceTree = SOURCE_ROOT; };
9F82DF6827DE93A2001B0EA8 /* SkipIntervalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkipIntervalView.swift; sourceTree = "<group>"; };
9F82DF6A27DE9792001B0EA8 /* NowPlayingMediaControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingMediaControlsView.swift; sourceTree = "<group>"; };
9F82DF6C27DE985A001B0EA8 /* NowPlayingPlaybackControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingPlaybackControlsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1082,9 +1077,6 @@
9FB20EB629A423410021663B /* InterfaceUpdater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceUpdater.swift; sourceTree = "<group>"; };
9FB20EB829A479FB0021663B /* BPAlertContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BPAlertContent.swift; sourceTree = "<group>"; };
9FB7C48C2835A2C1003B917E /* PlayerManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerManagerTests.swift; sourceTree = "<group>"; };
9FB7C48E2835A4C9003B917E /* EmptyLibraryServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyLibraryServiceMock.swift; sourceTree = "<group>"; };
9FB7C4902835A5A3003B917E /* EmptyPlaybackServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyPlaybackServiceMock.swift; sourceTree = "<group>"; };
9FB7C4922835A617003B917E /* EmptySpeedServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptySpeedServiceMock.swift; sourceTree = "<group>"; };
9FBDBC782879409600D315A2 /* SyncableItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncableItem.swift; sourceTree = "<group>"; };
9FBDBC7C287940D900D315A2 /* ContentsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentsResponse.swift; sourceTree = "<group>"; };
9FBDBC7F2879C6C900D315A2 /* UploadItemResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadItemResponse.swift; sourceTree = "<group>"; };
Expand All @@ -1102,13 +1094,11 @@
9FC1E45B2814E6A500522FA8 /* NetworkProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProvider.swift; sourceTree = "<group>"; };
9FC1E45E2814F66F00522FA8 /* AccountAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountAPI.swift; sourceTree = "<group>"; };
9FC1E4622814F80000522FA8 /* AccountServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountServiceMock.swift; sourceTree = "<group>"; };
9FC1E464281507BD00522FA8 /* SyncServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncServiceMock.swift; sourceTree = "<group>"; };
9FC1E4662815091A00522FA8 /* AccountServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountServiceTests.swift; sourceTree = "<group>"; };
9FC1E46828150ECC00522FA8 /* NetworkClientMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkClientMock.swift; sourceTree = "<group>"; };
9FC1E46A2815A8A800522FA8 /* LibraryAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryAPI.swift; sourceTree = "<group>"; };
9FC1E4742815C6A300522FA8 /* KeychainService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainService.swift; sourceTree = "<group>"; };
9FC1E4762815F97E00522FA8 /* KeychainServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainServiceTests.swift; sourceTree = "<group>"; };
9FC1E47A281600D500522FA8 /* KeychainServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainServiceMock.swift; sourceTree = "<group>"; };
9FCC228B2A172669003DD895 /* MappingModel_v8_to_v9.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = MappingModel_v8_to_v9.xcmappingmodel; sourceTree = "<group>"; };
9FD8D95729DC53750074C2D8 /* CoreServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreServices.swift; sourceTree = "<group>"; };
9FDDD2D7289B64440020C428 /* SyncStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncStatus.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1832,14 +1822,9 @@
62AAE22827492D6E001EB9FF /* Mocks */ = {
isa = PBXGroup;
children = (
62AAE22627492896001EB9FF /* PlayerManagerMock.swift */,
9F7C47522A2C15D300F9A500 /* AutoMockable.generated.swift */,
9FC1E4622814F80000522FA8 /* AccountServiceMock.swift */,
9FC1E464281507BD00522FA8 /* SyncServiceMock.swift */,
9FC1E46828150ECC00522FA8 /* NetworkClientMock.swift */,
9FC1E47A281600D500522FA8 /* KeychainServiceMock.swift */,
9FB7C48E2835A4C9003B917E /* EmptyLibraryServiceMock.swift */,
9FB7C4902835A5A3003B917E /* EmptyPlaybackServiceMock.swift */,
9FB7C4922835A617003B917E /* EmptySpeedServiceMock.swift */,
);
path = Mocks;
sourceTree = "<group>";
Expand Down Expand Up @@ -3178,27 +3163,22 @@
69343D36213A07B4000C425E /* VoiceOverServiceTest.swift in Sources */,
9F646006283AD6B700710D3C /* PlayerSettingsViewModelTests.swift in Sources */,
62AAE2252749283F001EB9FF /* MiniPlayerViewModelTests.swift in Sources */,
9FB7C48F2835A4C9003B917E /* EmptyLibraryServiceMock.swift in Sources */,
41C2340C27324AB7006BC7B8 /* ItemListViewModelTests.swift in Sources */,
41A1B13F226FEF9300EA0400 /* DataManagerTests.swift in Sources */,
9FB7C48D2835A2C1003B917E /* PlayerManagerTests.swift in Sources */,
4137BBD4272DF540009ED9FE /* PlayerCoordinatorTests.swift in Sources */,
416A9D4B2743D51E00463621 /* StorageViewModelTests.swift in Sources */,
4137BBD2272DED79009ED9FE /* ItemListCoordinatorTests.swift in Sources */,
9FC1E47B281600D500522FA8 /* KeychainServiceMock.swift in Sources */,
9F7C47532A2C15D300F9A500 /* AutoMockable.generated.swift in Sources */,
62AAE231274ABB5D001EB9FF /* LibraryServiceTests.swift in Sources */,
6906A553217211C600A9E0B2 /* StubFactory.swift in Sources */,
62AAE22727492896001EB9FF /* PlayerManagerMock.swift in Sources */,
6906A55021720FDF00A9E0B2 /* BookSortServiceTest.swift in Sources */,
6279361F272D0D110097837D /* MainCoordinatorTests.swift in Sources */,
9FBDDBA427DD1A00005FB447 /* ProfileCoordinatorTests.swift in Sources */,
9FC1E4632814F80000522FA8 /* AccountServiceMock.swift in Sources */,
9FC1E4672815091A00522FA8 /* AccountServiceTests.swift in Sources */,
9FC1E4772815F97E00522FA8 /* KeychainServiceTests.swift in Sources */,
4137BBD0272DEBEC009ED9FE /* LoadingCoordinatorTests.swift in Sources */,
9FC1E465281507BD00522FA8 /* SyncServiceMock.swift in Sources */,
9FB7C4912835A5A3003B917E /* EmptyPlaybackServiceMock.swift in Sources */,
9FB7C4932835A617003B917E /* EmptySpeedServiceMock.swift in Sources */,
41A1B13E226FEF8000EA0400 /* DataTestUtils.swift in Sources */,
9FC1E46928150ECC00522FA8 /* NetworkClientMock.swift in Sources */,
9F8A9A5E27AC3F8C0093AA1C /* PlayableItemTests.swift in Sources */,
Expand Down
Loading

0 comments on commit 62076a0

Please sign in to comment.