@@ -224,4 +224,116 @@ public void DisplayBanner_WithVariousModes_Succeeds(string mode)
224224 // Assert - No exception thrown
225225 _ = banner . Should ( ) . NotBeNull ( ) ;
226226 }
227+
228+ /// <summary>
229+ /// Verifies that DisplayBanner displays service configuration when install path is set.
230+ /// </summary>
231+ [ Fact ]
232+ public void DisplayBanner_WithServiceInstallPath_DisplaysServiceConfiguration ( )
233+ {
234+ // Arrange
235+ var config = new Config . Models . SharedConfiguration
236+ {
237+ McpNexus = new Config . Models . McpNexusSettings
238+ {
239+ Service = new Config . Models . ServiceSettings
240+ {
241+ InstallPath = @"C:\Program Files\MCP-Nexus" ,
242+ BackupPath = @"C:\Program Files\MCP-Nexus\Backup" ,
243+ } ,
244+ } ,
245+ } ;
246+ _ = m_Settings . Setup ( s => s . Get ( ) ) . Returns ( config ) ;
247+ var context = new CommandLineContext ( Array . Empty < string > ( ) ) ;
248+ var banner = new StartupBanner ( false , context , m_Settings . Object ) ;
249+
250+ // Act
251+ banner . DisplayBanner ( ) ;
252+
253+ // Assert - No exception thrown, service configuration should be displayed
254+ _ = banner . Should ( ) . NotBeNull ( ) ;
255+ }
256+
257+ /// <summary>
258+ /// Verifies that DisplayBanner handles null settings values gracefully.
259+ /// </summary>
260+ [ Fact ]
261+ public void DisplayBanner_WithNullSettingsValues_HandlesGracefully ( )
262+ {
263+ // Arrange
264+ var config = new Config . Models . SharedConfiguration
265+ {
266+ McpNexus = new Config . Models . McpNexusSettings
267+ {
268+ Server = new Config . Models . ServerSettings
269+ {
270+ Host = null ! ,
271+ Port = 5511 ,
272+ } ,
273+ Transport = new Config . Models . TransportSettings
274+ {
275+ Mode = null ! ,
276+ ServiceMode = false ,
277+ } ,
278+ Debugging = new Config . Models . DebuggingSettings
279+ {
280+ CdbPath = null ! ,
281+ CommandTimeoutMs = 30000 ,
282+ SymbolServerMaxRetries = 3 ,
283+ SymbolSearchPath = null ! ,
284+ StartupDelayMs = 0 ,
285+ } ,
286+ Service = new Config . Models . ServiceSettings
287+ {
288+ InstallPath = null ! ,
289+ BackupPath = null ! ,
290+ } ,
291+ } ,
292+ Logging = new Config . Models . LoggingSettings
293+ {
294+ LogLevel = null ! ,
295+ } ,
296+ } ;
297+ _ = m_Settings . Setup ( s => s . Get ( ) ) . Returns ( config ) ;
298+ var context = new CommandLineContext ( Array . Empty < string > ( ) ) ;
299+ var banner = new StartupBanner ( false , context , m_Settings . Object ) ;
300+
301+ // Act
302+ banner . DisplayBanner ( ) ;
303+
304+ // Assert - No exception thrown
305+ _ = banner . Should ( ) . NotBeNull ( ) ;
306+ }
307+
308+ /// <summary>
309+ /// Verifies that DisplayBanner handles empty string settings values gracefully.
310+ /// </summary>
311+ [ Fact ]
312+ public void DisplayBanner_WithEmptyStringSettingsValues_HandlesGracefully ( )
313+ {
314+ // Arrange
315+ var config = new Config . Models . SharedConfiguration
316+ {
317+ McpNexus = new Config . Models . McpNexusSettings
318+ {
319+ Debugging = new Config . Models . DebuggingSettings
320+ {
321+ CdbPath = string . Empty ,
322+ SymbolSearchPath = string . Empty ,
323+ CommandTimeoutMs = 30000 ,
324+ SymbolServerMaxRetries = 3 ,
325+ StartupDelayMs = 0 ,
326+ } ,
327+ } ,
328+ } ;
329+ _ = m_Settings . Setup ( s => s . Get ( ) ) . Returns ( config ) ;
330+ var context = new CommandLineContext ( Array . Empty < string > ( ) ) ;
331+ var banner = new StartupBanner ( false , context , m_Settings . Object ) ;
332+
333+ // Act
334+ banner . DisplayBanner ( ) ;
335+
336+ // Assert - No exception thrown
337+ _ = banner . Should ( ) . NotBeNull ( ) ;
338+ }
227339}
0 commit comments