@@ -73,17 +73,35 @@ suite("Asset generation: csproj", () => {
7373 segments . should . deep . equal ( [ '${workspaceFolder}' , 'bin' , 'Debug' , 'netcoreapp1.0' , 'testApp.dll' ] ) ;
7474 } ) ;
7575
76- test ( "Create launch.json for NET 5 project opened in workspace" , ( ) => {
77- let rootPath = path . resolve ( 'testRoot' ) ;
78- let info = createMSBuildWorkspaceInformation ( path . join ( rootPath , 'testApp.csproj' ) , 'testApp' , 'net5.0' , /*isExe*/ true ) ;
79- let generator = new AssetGenerator ( info , createMockWorkspaceFolder ( rootPath ) ) ;
80- generator . setStartupProject ( 0 ) ;
81- let launchJson = parse ( generator . createLaunchJsonConfigurations ( ProgramLaunchType . Console ) , undefined , { disallowComments : true } ) ;
82- let programPath = launchJson [ 0 ] . program ;
83-
84- // ${workspaceFolder}/bin/Debug/net5.0/testApp.dll
85- let segments = programPath . split ( path . posix . sep ) ;
86- segments . should . deep . equal ( [ '${workspaceFolder}' , 'bin' , 'Debug' , 'net5.0' , 'testApp.dll' ] ) ;
76+ [ 5 , 6 , 7 , 8 , 9 ] . forEach ( version => {
77+ const shortName = `net${ version } .0` ;
78+ const alternameShortName = `net${ version } 0` ;
79+
80+ test ( `Create launch.json for NET ${ version } project opened in workspace with shortname '${ shortName } '` , ( ) => {
81+ let rootPath = path . resolve ( 'testRoot' ) ;
82+ let info = createMSBuildWorkspaceInformation ( path . join ( rootPath , 'testApp.csproj' ) , 'testApp' , shortName , /*isExe*/ true ) ;
83+ let generator = new AssetGenerator ( info , createMockWorkspaceFolder ( rootPath ) ) ;
84+ generator . setStartupProject ( 0 ) ;
85+ let launchJson = parse ( generator . createLaunchJsonConfigurations ( ProgramLaunchType . Console ) , undefined , { disallowComments : true } ) ;
86+ let programPath = launchJson [ 0 ] . program ;
87+
88+ // ${workspaceFolder}/bin/Debug/net#.0/testApp.dll
89+ let segments = programPath . split ( path . posix . sep ) ;
90+ segments . should . deep . equal ( [ '${workspaceFolder}' , 'bin' , 'Debug' , shortName , 'testApp.dll' ] ) ;
91+ } ) ;
92+
93+ test ( `Create launch.json for NET ${ version } project opened in workspace with shortname '${ alternameShortName } '` , ( ) => {
94+ let rootPath = path . resolve ( 'testRoot' ) ;
95+ let info = createMSBuildWorkspaceInformation ( path . join ( rootPath , 'testApp.csproj' ) , 'testApp' , alternameShortName , /*isExe*/ true ) ;
96+ let generator = new AssetGenerator ( info , createMockWorkspaceFolder ( rootPath ) ) ;
97+ generator . setStartupProject ( 0 ) ;
98+ let launchJson = parse ( generator . createLaunchJsonConfigurations ( ProgramLaunchType . Console ) , undefined , { disallowComments : true } ) ;
99+ let programPath = launchJson [ 0 ] . program ;
100+
101+ // ${workspaceFolder}/bin/Debug/net#.0/testApp.dll
102+ let segments = programPath . split ( path . posix . sep ) ;
103+ segments . should . deep . equal ( [ '${workspaceFolder}' , 'bin' , 'Debug' , shortName , 'testApp.dll' ] ) ;
104+ } ) ;
87105 } ) ;
88106
89107 test ( "Create launch.json for nested project opened in workspace" , ( ) => {
0 commit comments