Skip to content

Commit f6350b1

Browse files
committed
made MCVE compilable... and now it passes
1 parent 87607bb commit f6350b1

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

RubberduckTests/Inspections/ParameterCanBeByValInspectionTests.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ public class ParameterCanBeByValInspectionTests
2020
[TestCategory("Inspections")]
2121
public void ParameterCanBeByVal_NoResultForByValObjectInInterfaceImplementationProperty()
2222
{
23+
const string modelCode = @"
24+
Option Explicit
25+
Public Foo As Long
26+
Public Bar As String
27+
";
28+
2329
const string interfaceCode = @"
2430
Option Explicit
2531
26-
Public Property Get Model() As Object
32+
Public Property Get Model() As MyModel
2733
End Property
2834
29-
Public Property Set Model(ByVal value As Object)
35+
Public Property Set Model(ByVal value As MyModel)
3036
End Property
3137
3238
Public Property Get IsCancelled() As Boolean
@@ -41,24 +47,23 @@ Option Explicit
4147
Private Type TView
4248
Model As MyModel
4349
IsCancelled As Boolean
44-
Validator As New NumKeyValidator
4550
End Type
4651
Private this As TView
4752
Implements IView
4853
49-
Private Property Get IDailySalesView_IsCancelled() As Boolean
50-
IDailySalesView_IsCancelled = this.IsCancelled
54+
Private Property Get IView_IsCancelled() As Boolean
55+
IView_IsCancelled = this.IsCancelled
5156
End Property
5257
53-
Private Property Set IDailySalesView_Model(ByVal value As Object)
58+
Private Property Set IView_Model(ByVal value As MyModel)
5459
Set this.Model = value
5560
End Property
5661
57-
Private Property Get IDailySalesView_Model() As Object
58-
Set IDailySalesView_Model = this.Model
62+
Private Property Get IView_Model() As MyModel
63+
Set IView_Model = this.Model
5964
End Property
6065
61-
Private Sub IDailySalesView_Show()
66+
Private Sub IView_Show()
6267
Me.Show vbModal
6368
End Sub
6469
";
@@ -67,6 +72,7 @@ End Sub
6772
var builder = new MockVbeBuilder();
6873
var vbe = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected)
6974
.AddComponent("IView", ComponentType.ClassModule, interfaceCode)
75+
.AddComponent("MyModel", ComponentType.ClassModule, modelCode)
7076
.AddComponent("MyForm", ComponentType.UserForm, implementationCode)
7177
.MockVbeBuilder().Build();
7278

0 commit comments

Comments
 (0)