File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
using ConsoleHero . Helpers ;
2
2
using ConsoleHero . Interfaces ;
3
3
using Moq ;
4
+ using System . Diagnostics ;
4
5
5
6
namespace ConsoleHero . Test ;
6
7
@@ -59,14 +60,19 @@ public void Beep_MacOSPlatform_StartsProcess()
59
60
[ TestMethod ]
60
61
public void Beep_NonWindowsPlatformWithException_WritesBellCharacter ( )
61
62
{
63
+ Mock < IProcessRunner > processRunnerMock = new ( ) ;
64
+ processRunnerMock . Setup ( p => p . Start ( It . IsAny < ProcessStartInfo > ( ) ) ) . Throws ( new InvalidOperationException ( ) ) ;
65
+
62
66
_platformHelperMock . Setup ( p => p . IsWindows ) . Returns ( false ) ;
63
67
_platformHelperMock . Setup ( p => p . IsLinux ) . Returns ( true ) ;
64
68
using ConsoleOutput consoleOutput = new ( ) ;
65
69
66
- // Act
67
70
_beepHelper . Beep ( 1000 , 500 ) ;
68
71
69
- // Assert
70
72
Assert . AreEqual ( "\a " , consoleOutput . GetOutput ( ) ) ;
71
73
}
74
+ public interface IProcessRunner
75
+ {
76
+ void Start ( ProcessStartInfo startInfo ) ;
77
+ }
72
78
}
You can’t perform that action at this time.
0 commit comments