-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some unit tests for shared presenter
- Loading branch information
Showing
9 changed files
with
356 additions
and
74 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
90 changes: 90 additions & 0 deletions
90
BSSpeechRecognizer.xcodeproj/xcshareddata/xcschemes/BSSpeechRecognizer.xcscheme
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,90 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1420" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "DB86679C29A3491700D22114" | ||
BuildableName = "BSSpeechRecognizer.framework" | ||
BlueprintName = "BSSpeechRecognizer" | ||
ReferencedContainer = "container:BSSpeechRecognizer.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
codeCoverageEnabled = "YES" | ||
onlyGenerateCoverageForSpecifiedTargets = "YES"> | ||
<CodeCoverageTargets> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "DB86679C29A3491700D22114" | ||
BuildableName = "BSSpeechRecognizer.framework" | ||
BlueprintName = "BSSpeechRecognizer" | ||
ReferencedContainer = "container:BSSpeechRecognizer.xcodeproj"> | ||
</BuildableReference> | ||
</CodeCoverageTargets> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES" | ||
testExecutionOrdering = "random"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "DB8667A429A3491700D22114" | ||
BuildableName = "BSSpeechRecognizerTests.xctest" | ||
BlueprintName = "BSSpeechRecognizerTests" | ||
ReferencedContainer = "container:BSSpeechRecognizer.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "DB86679C29A3491700D22114" | ||
BuildableName = "BSSpeechRecognizer.framework" | ||
BlueprintName = "BSSpeechRecognizer" | ||
ReferencedContainer = "container:BSSpeechRecognizer.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// BSSpeechRecognizerConfigurable.swift | ||
// BSSpeechRecognizer | ||
// | ||
// Created by 林翌埕-20001107 on 2023/2/21. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol BSSpeechRecognizerConfigurable { | ||
var locale: Locale { get set } | ||
|
||
/// This is NOT a time based duration | ||
/// This value is more like a counter based on AVAudioNode's tap | ||
var maxRecordDuration: Double { get set } | ||
|
||
var waveViewVisibleAnimateDuration: TimeInterval { get set } | ||
} | ||
|
||
public struct BSSpeechRecognizerConfiguration: BSSpeechRecognizerConfigurable { | ||
public var locale: Locale | ||
public var maxRecordDuration: Double | ||
public var waveViewVisibleAnimateDuration: TimeInterval | ||
|
||
public init(locale: Locale = .init(identifier: "zh-TW"), | ||
maxRecordDuration: Double = 300, | ||
waveViewVisibleAnimateDuration: TimeInterval = 0.5) { | ||
self.locale = locale | ||
self.maxRecordDuration = maxRecordDuration | ||
self.waveViewVisibleAnimateDuration = waveViewVisibleAnimateDuration | ||
} | ||
} |
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
Oops, something went wrong.