Skip to content

Commit 6ed2673

Browse files
authored
Merge pull request #2342 from retailcoder/next
down to 11 failing tests
2 parents d635094 + 1df40dd commit 6ed2673

File tree

6 files changed

+11
-187
lines changed

6 files changed

+11
-187
lines changed

Rubberduck.Parsing/Rubberduck.Parsing.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@
282282
<Compile Include="VBA\IAttributeParser.cs" />
283283
<Compile Include="VBA\IModuleExporter.cs" />
284284
<Compile Include="VBA\ModuleState.cs" />
285-
<Compile Include="VBA\Nodes\INode.cs" />
286-
<Compile Include="VBA\Nodes\Node.cs" />
287285
<Compile Include="VBA\ParseErrorEventArgs.cs" />
288286
<Compile Include="VBA\ParserState.cs" />
289287
<Compile Include="VBA\ReferencePriorityMap.cs" />

Rubberduck.Parsing/VBA/Nodes/INode.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

Rubberduck.Parsing/VBA/Nodes/Node.cs

Lines changed: 0 additions & 83 deletions
This file was deleted.

RubberduckTests/Mocks/MockFactory.cs

Lines changed: 0 additions & 54 deletions
This file was deleted.

RubberduckTests/RubberduckTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
<Compile Include="Inspections\VariableNotAssignedInspectionTests.cs" />
136136
<Compile Include="Inspections\VariableNotUsedInspectionTests.cs" />
137137
<Compile Include="Inspections\VariableTypeNotDeclaredInspectionTests.cs" />
138-
<Compile Include="Mocks\MockFactory.cs" />
139138
<Compile Include="Mocks\MockProjectBuilder.cs" />
140139
<Compile Include="Mocks\MockUserFormBuilder.cs" />
141140
<Compile Include="Mocks\MockVbeBuilder.cs" />

RubberduckTests/SourceControl/SourceControlViewModelTests.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@
1111
using Rubberduck.UI.SourceControl;
1212
using Rubberduck.VBEditor.Application;
1313
using Rubberduck.VBEditor.Events;
14+
using Rubberduck.VBEditor.SafeComWrappers;
1415
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
15-
using Rubberduck.VBEditor.SafeComWrappers.VBA;
1616
using RubberduckTests.Mocks;
17-
using Windows = RubberduckTests.Mocks.Windows;
1817

1918
namespace RubberduckTests.SourceControl
2019
{
2120
[TestClass]
2221
public class SourceControlViewModelTests
2322
{
2423
private Mock<IVBE> _vbe;
25-
private Windows _windows;
26-
private Mock<IWindow> _window;
24+
2725
#pragma warning disable 169
2826
private object _toolWindow;
2927
#pragma warning restore 169
@@ -46,9 +44,12 @@ public class SourceControlViewModelTests
4644
[TestInitialize]
4745
public void InitializeMocks()
4846
{
49-
_window = Mocks.MockFactory.CreateWindowMock();
50-
_windows = new Windows() { _window.Object };
51-
_vbe = Mocks.MockFactory.CreateVbeMock(_windows);
47+
_vbe = new MockVbeBuilder()
48+
.ProjectBuilder("TestProject1", ProjectProtection.Unprotected)
49+
.AddComponent("Module1", ComponentType.StandardModule, string.Empty)
50+
.MockVbeBuilder()
51+
.Build();
52+
5253

5354
var mockHost = new Mock<IHostApplication>();
5455
mockHost.SetupAllProperties();
@@ -500,7 +501,7 @@ public void OpenWorkingDir_WhenProviderCreationFails_MessageIsShown()
500501
_folderBrowser.Setup(b => b.ShowDialog()).Returns(DialogResult.OK);
501502
_folderBrowser.SetupProperty(b => b.SelectedPath, @"C:\path\to\repo\");
502503

503-
_providerFactory.Setup(f => f.CreateProvider(It.IsAny<VBProject>(), It.IsAny<IRepository>()))
504+
_providerFactory.Setup(f => f.CreateProvider(It.IsAny<IVBProject>(), It.IsAny<IRepository>()))
504505
.Throws(new SourceControlException(expectedTitle,
505506
new LibGit2Sharp.LibGit2SharpException(expectedMessage))
506507
);
@@ -609,7 +610,7 @@ public void UnsyncedPresenter_AfterLogin_NewPresenterIsCreatedWithCredentials()
609610
_vm.CreateProviderWithCredentials(new SecureCredentials(username, password));
610611

611612
//assert
612-
_providerFactory.Verify(f => f.CreateProvider(It.IsAny<VBProject>(), It.IsAny<IRepository>(), It.IsAny<SecureCredentials>()));
613+
_providerFactory.Verify(f => f.CreateProvider(It.IsAny<IVBProject>(), It.IsAny<IRepository>(), It.IsAny<SecureCredentials>()));
613614
}
614615

615616
[TestMethod]
@@ -929,7 +930,7 @@ public void OpenDirAssignedToRepo_WhenProviderCreationFails_MessageIsShown()
929930
_folderBrowser.Setup(b => b.ShowDialog()).Returns(DialogResult.OK);
930931
_folderBrowser.SetupProperty(b => b.SelectedPath, @"C:\path\to\repo\");
931932

932-
_providerFactory.Setup(f => f.CreateProvider(It.IsAny<VBProject>(), It.IsAny<IRepository>()))
933+
_providerFactory.Setup(f => f.CreateProvider(It.IsAny<IVBProject>(), It.IsAny<IRepository>()))
933934
.Throws(new SourceControlException(expectedTitle,
934935
new LibGit2Sharp.LibGit2SharpException(expectedMessage))
935936
);

0 commit comments

Comments
 (0)