@@ -15,7 +15,7 @@ public void SupportsInteractiveInput_ReturnsTrue_WhenNoConfigSet()
1515 var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
1616
1717 // Act
18- var env = new CliHostEnvironment ( configuration ) ;
18+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
1919
2020 // Assert
2121 Assert . True ( env . SupportsInteractiveInput ) ;
@@ -28,7 +28,7 @@ public void SupportsInteractiveOutput_ReturnsTrue_WhenNoConfigSet()
2828 var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
2929
3030 // Act
31- var env = new CliHostEnvironment ( configuration ) ;
31+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
3232
3333 // Assert
3434 Assert . True ( env . SupportsInteractiveOutput ) ;
@@ -41,7 +41,7 @@ public void SupportsAnsi_ReturnsTrue_WhenNoConfigSet()
4141 var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
4242
4343 // Act
44- var env = new CliHostEnvironment ( configuration ) ;
44+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
4545
4646 // Assert
4747 Assert . True ( env . SupportsAnsi ) ;
@@ -61,7 +61,7 @@ public void SupportsInteractiveInput_ReturnsFalse_WhenNonInteractiveSet(string k
6161 . Build ( ) ;
6262
6363 // Act
64- var env = new CliHostEnvironment ( configuration ) ;
64+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
6565
6666 // Assert
6767 Assert . False ( env . SupportsInteractiveInput ) ;
@@ -81,7 +81,7 @@ public void SupportsInteractiveOutput_ReturnsFalse_WhenNonInteractiveSet(string
8181 . Build ( ) ;
8282
8383 // Act
84- var env = new CliHostEnvironment ( configuration ) ;
84+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
8585
8686 // Assert
8787 Assert . False ( env . SupportsInteractiveOutput ) ;
@@ -104,7 +104,7 @@ public void SupportsInteractiveInput_ReturnsFalse_InCIEnvironment(string envVar,
104104 . Build ( ) ;
105105
106106 // Act
107- var env = new CliHostEnvironment ( configuration ) ;
107+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
108108
109109 // Assert
110110 Assert . False ( env . SupportsInteractiveInput ) ;
@@ -126,7 +126,7 @@ public void SupportsInteractiveOutput_ReturnsFalse_InCIEnvironment(string envVar
126126 . Build ( ) ;
127127
128128 // Act
129- var env = new CliHostEnvironment ( configuration ) ;
129+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
130130
131131 // Assert
132132 Assert . False ( env . SupportsInteractiveOutput ) ;
@@ -147,7 +147,7 @@ public void SupportsAnsi_ReturnsTrue_InCIEnvironment(string envVar, string value
147147 . Build ( ) ;
148148
149149 // Act
150- var env = new CliHostEnvironment ( configuration ) ;
150+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
151151
152152 // Assert
153153 Assert . True ( env . SupportsAnsi ) ;
@@ -165,9 +165,48 @@ public void SupportsAnsi_ReturnsFalse_WhenNO_COLORSet()
165165 . Build ( ) ;
166166
167167 // Act
168- var env = new CliHostEnvironment ( configuration ) ;
168+ var env = new CliHostEnvironment ( configuration , nonInteractive : false ) ;
169169
170170 // Assert
171171 Assert . False ( env . SupportsAnsi ) ;
172172 }
173+
174+ [ Fact ]
175+ public void SupportsInteractiveInput_ReturnsFalse_WhenNonInteractiveTrue ( )
176+ {
177+ // Arrange
178+ var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
179+
180+ // Act
181+ var env = new CliHostEnvironment ( configuration , nonInteractive : true ) ;
182+
183+ // Assert
184+ Assert . False ( env . SupportsInteractiveInput ) ;
185+ }
186+
187+ [ Fact ]
188+ public void SupportsInteractiveOutput_ReturnsFalse_WhenNonInteractiveTrue ( )
189+ {
190+ // Arrange
191+ var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
192+
193+ // Act
194+ var env = new CliHostEnvironment ( configuration , nonInteractive : true ) ;
195+
196+ // Assert
197+ Assert . False ( env . SupportsInteractiveOutput ) ;
198+ }
199+
200+ [ Fact ]
201+ public void SupportsAnsi_ReturnsTrue_WhenNonInteractiveTrue ( )
202+ {
203+ // Arrange - ANSI should still be supported even in non-interactive mode
204+ var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
205+
206+ // Act
207+ var env = new CliHostEnvironment ( configuration , nonInteractive : true ) ;
208+
209+ // Assert
210+ Assert . True ( env . SupportsAnsi ) ;
211+ }
173212}
0 commit comments