Browse Source

Adjust unit tests.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
505d861a86
  1. 6
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs
  2. 3
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  3. 14
      src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs
  4. 12
      src/Main/Base/Test/NavigationServiceTests/NavigationServiceTestFixture.cs

6
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs

@ -263,14 +263,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -263,14 +263,12 @@ namespace ICSharpCode.SharpDevelop.Project
public static void RefreshViewAsync()
{
SD.MainThread.VerifyAccess();
if (refreshViewEnqueued || SD.Workbench == null)
if (refreshViewEnqueued || instance == null)
return;
refreshViewEnqueued = true;
SD.MainThread.InvokeAsync(delegate {
refreshViewEnqueued = false;
if (instance != null) {
instance.ProjectBrowserControl.RefreshView();
}
instance.ProjectBrowserControl.RefreshView();
}).FireAndForget();
}
}

3
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -19,6 +19,7 @@ using ICSharpCode.SharpDevelop.Dom; @@ -19,6 +19,7 @@ using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Workbench;
namespace ICSharpCode.SharpDevelop.Project
{
@ -107,7 +108,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -107,7 +108,7 @@ namespace ICSharpCode.SharpDevelop.Project
SD.MainThread.VerifyAccess();
Debug.Assert(FileUtility.IsUrl(value) || Path.IsPathRooted(value));
if (SD.Workbench == null)
if (SD.Services.GetService(typeof(IWorkbench)) == null)
watcher = new MockProjectChangeWatcher();
if (watcher == null) {

14
src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs

@ -219,20 +219,6 @@ namespace ICSharpCode.SharpDevelop @@ -219,20 +219,6 @@ namespace ICSharpCode.SharpDevelop
OnHistoryChanged();
}
// Unit test covered but the test does not yet verify the results.
public static INavigationPoint Log()
{
if (SD.Workbench == null) {
return null;
}
IViewContent view = SD.Workbench.ActiveViewContent;
if (view == null) {
return null;
}
return view.BuildNavPoint();
}
/// <summary>
/// Gets a <see cref="List{T}"/> of the <see cref="INavigationPoint">INavigationPoints</see> that
/// are currently in the collection.

12
src/Main/Base/Test/NavigationServiceTests/NavigationServiceTestFixture.cs

@ -472,18 +472,6 @@ namespace ICSharpCode.SharpDevelop.Tests.NavigationServiceTests @@ -472,18 +472,6 @@ namespace ICSharpCode.SharpDevelop.Tests.NavigationServiceTests
{
navigationChangedCount++;
}
[Test]
/// <summary>
/// The <see cref="NavigationService"/> must
/// expose a method to generate an
/// <see cref="INavigationPoint"/> from a
/// given window.
/// </summary>
public void GenerateCurrentPositionTest()
{
INavigationPoint p = NavigationService.Log();
}
#endregion
[Test]

Loading…
Cancel
Save