Skip to content

Commit 26cbb1a

Browse files
committed
Rename unit test helper class, readd Refresh to CE context menu, don't assign helpfile for protected projects.
1 parent 01757c0 commit 26cbb1a

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@
951951
<Compile Include="UnitTesting\AssertClass.cs" />
952952
<Compile Include="UnitTesting\AssertCompletedEventArgs.cs" />
953953
<Compile Include="UnitTesting\AssertHandler.cs" />
954-
<Compile Include="UnitTesting\UnitTestHelpers.cs" />
954+
<Compile Include="UnitTesting\UnitTestUtils.cs" />
955955
<Compile Include="UnitTesting\IAssert.cs" />
956956
<Compile Include="UnitTesting\ITestEngine.cs" />
957957
<Compile Include="UnitTesting\ITestRunner.cs" />

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@
357357
<Setter Property="ContextMenu">
358358
<Setter.Value>
359359
<ContextMenu DataContext="{Binding DataContext, Source={x:Reference CodeExplorer}}">
360+
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Refresh}"
361+
Command="{Binding RefreshCommand}">
362+
<MenuItem.Icon>
363+
<Image Source="{StaticResource RefreshImage}" />
364+
</MenuItem.Icon>
365+
</MenuItem>
360366
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Navigate}"
361367
FontWeight="Bold"
362368
Command="{Binding NavigateCommand}"

RetailCoder.VBE/UI/UnitTesting/TestExplorerModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private void State_StateChanged(object sender, ParserStateEventArgs e)
3131

3232
_dispatcher.Invoke(() =>
3333
{
34-
var tests = UnitTestHelpers.GetAllTests(_vbe, _state).ToList();
34+
var tests = UnitTestUtils.GetAllTests(_vbe, _state).ToList();
3535

3636
var removedTests = Tests.Where(test =>
3737
!tests.Any(t =>

RetailCoder.VBE/UnitTesting/UnitTestHelpers.cs renamed to RetailCoder.VBE/UnitTesting/UnitTestUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Rubberduck.UnitTesting
1010
{
11-
public static class UnitTestHelpers
11+
public static class UnitTestUtils
1212
{
1313
public static IEnumerable<TestMethod> GetAllTests(VBE vbe, RubberduckParserState state)
1414
{

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ public void RefreshProjects()
209209
_projects.Clear();
210210
foreach (VBProject project in _vbe.VBProjects)
211211
{
212+
if (project.Protection == vbext_ProjectProtection.vbext_pp_locked)
213+
{
214+
continue;
215+
}
216+
212217
if (string.IsNullOrEmpty(project.HelpFile) || _projects.Keys.Contains(project.HelpFile))
213218
{
214219
project.AssignProjectId();

RubberduckTests/UnitTesting/DiscoveryTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Public Sub TestMethod1()
3434
parser.Parse(new CancellationTokenSource());
3535
if (parser.State.Status >= ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3636

37-
Assert.AreEqual(1, UnitTestHelpers.GetAllTests(vbe.Object, parser.State).Count());
37+
Assert.AreEqual(1, UnitTestUtils.GetAllTests(vbe.Object, parser.State).Count());
3838
}
3939

4040
[TestMethod]
@@ -55,7 +55,7 @@ public void Discovery_IgnoresNonAnnotatedTestMethods()
5555
parser.Parse(new CancellationTokenSource());
5656
if (parser.State.Status >= ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5757

58-
Assert.IsFalse(UnitTestHelpers.GetAllTests(vbe.Object, parser.State).Any());
58+
Assert.IsFalse(UnitTestUtils.GetAllTests(vbe.Object, parser.State).Any());
5959
}
6060

6161
[TestMethod]
@@ -77,7 +77,7 @@ Public Sub TestMethod1()
7777
parser.Parse(new CancellationTokenSource());
7878
if (parser.State.Status >= ParserState.Error) { Assert.Inconclusive("Parser Error"); }
7979

80-
Assert.IsFalse(UnitTestHelpers.GetAllTests(vbe.Object, parser.State).Any());
80+
Assert.IsFalse(UnitTestUtils.GetAllTests(vbe.Object, parser.State).Any());
8181
}
8282

8383
[TestMethod]

0 commit comments

Comments
 (0)