aboutsummaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Exfiltration.tests.ps131
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/Exfiltration.tests.ps1 b/Tests/Exfiltration.tests.ps1
index e4f60d5..ed98f45 100644
--- a/Tests/Exfiltration.tests.ps1
+++ b/Tests/Exfiltration.tests.ps1
@@ -52,3 +52,34 @@ Describe 'Get-Keystrokes' {
Remove-Item -Force "$($env:TEMP)\key.log"
}
+
+Describe "Get-MicrophoneAudio" {
+
+ $RecordPath = "$env:TEMP\test_record.wav"
+ $RecordLen = 2
+ Context 'Successful Recording' {
+ BeforeEach {
+ #Ensure the recording as been removed prior to testing
+ Remove-Item -Path $RecordPath -ErrorAction SilentlyContinue
+ }
+
+ AfterEach {
+ #Remove the recording after testing
+ Remove-Item -Path $RecordPath -ErrorAction SilentlyContinue
+ }
+
+ It 'should record audio from the microphone and save it to a specified path' {
+ $result = Get-MicrophoneAudio -Path $RecordPath -Length $RecordLen
+ $result | Should Not BeNullOrEmpty
+ $result.Length | Should BeGreaterThan 0
+ }
+
+ }
+
+ Context 'Invalid Arguments' {
+ It 'should not allow invalid paths to be used' {
+ { Get-MicrophoneAudio -Path "c:\FAKEPATH\yay.wav" -Length RecordLen} | Should Throw
+ }
+ }
+
+}