public async Task ProjectDebuggerProvider_QueryDebugTargetsAsyncCorrectProvider() { var debugger = new ProjectDebuggerProvider(_configuredProjectMoq.Object, _LaunchSettingsProviderMoq.Object, _launchProviders); _activeProfile = new LaunchProfile() { Name = "test", CommandName = "IISExpress" }; var result = await debugger.QueryDebugTargetsAsync(0); Assert.Equal(_webProviderSettings, result); _activeProfile = new LaunchProfile() { Name = "test", CommandName = "Docker" }; result = await debugger.QueryDebugTargetsAsync(0); Assert.Equal(_dockerProviderSettings, result); _activeProfile = new LaunchProfile() { Name = "test", CommandName = "Project" }; result = await debugger.QueryDebugTargetsAsync(0); Assert.Equal(_exeProviderSettings, result); }
public async Task QueryDebugTargetsAsync_WhenNoLaunchProfile_Throws() { var debugger = new ProjectDebuggerProvider(_configuredProjectMoq.Object, _LaunchSettingsProviderMoq.Object, _launchProviders); _activeProfile = null; var exception = await Assert.ThrowsAsync <Exception>(() => { return(debugger.QueryDebugTargetsAsync(0)); }); }
public async Task QueryDebugTargetsAsync_WhenNoInstalledProvider_Throws() { var debugger = new ProjectDebuggerProvider(_configuredProjectMoq.Object, _LaunchSettingsProviderMoq.Object, _launchProviders); _activeProfile = new LaunchProfile() { Name = "NoActionProfile", CommandName = "SomeOtherExtension" }; var exception = await Assert.ThrowsAsync <Exception>(() => { return(debugger.QueryDebugTargetsAsync(0)); }); }
public async Task ProjectDebuggerProvider_QueryDebugTargetsNoLaunchProfiler() { var debugger = new ProjectDebuggerProvider(_configuredProjectMoq.Object, _LaunchSettingsProviderMoq.Object, _launchProviders); _activeProfile = null; try { var result = await debugger.QueryDebugTargetsAsync(0); Assert.False(true); } catch (Exception ex) { Assert.Equal(VSResources.ActiveLaunchProfileNotFound, ex.Message); } }
public async Task ProjectDebuggerProvider_QueryDebugTargetsNoInstalledProvider() { var debugger = new ProjectDebuggerProvider(_configuredProjectMoq.Object, _LaunchSettingsProviderMoq.Object, _launchProviders); _activeProfile = new LaunchProfile() { Name = "NoActionProfile", CommandName = "SomeOtherExtension" }; try { var result = await debugger.QueryDebugTargetsAsync(0); Assert.False(true); } catch (Exception ex) { Assert.Equal(string.Format(VSResources.DontKnowHowToRunProfile, _activeProfile.Name), ex.Message); } }