@@ -20,13 +20,19 @@ public class ParameterCanBeByValInspectionTests
20
20
[ TestCategory ( "Inspections" ) ]
21
21
public void ParameterCanBeByVal_NoResultForByValObjectInInterfaceImplementationProperty ( )
22
22
{
23
+ const string modelCode = @"
24
+ Option Explicit
25
+ Public Foo As Long
26
+ Public Bar As String
27
+ " ;
28
+
23
29
const string interfaceCode = @"
24
30
Option Explicit
25
31
26
- Public Property Get Model() As Object
32
+ Public Property Get Model() As MyModel
27
33
End Property
28
34
29
- Public Property Set Model(ByVal value As Object )
35
+ Public Property Set Model(ByVal value As MyModel )
30
36
End Property
31
37
32
38
Public Property Get IsCancelled() As Boolean
@@ -41,24 +47,23 @@ Option Explicit
41
47
Private Type TView
42
48
Model As MyModel
43
49
IsCancelled As Boolean
44
- Validator As New NumKeyValidator
45
50
End Type
46
51
Private this As TView
47
52
Implements IView
48
53
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
51
56
End Property
52
57
53
- Private Property Set IDailySalesView_Model (ByVal value As Object )
58
+ Private Property Set IView_Model (ByVal value As MyModel )
54
59
Set this.Model = value
55
60
End Property
56
61
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
59
64
End Property
60
65
61
- Private Sub IDailySalesView_Show ()
66
+ Private Sub IView_Show ()
62
67
Me.Show vbModal
63
68
End Sub
64
69
" ;
@@ -67,6 +72,7 @@ End Sub
67
72
var builder = new MockVbeBuilder ( ) ;
68
73
var vbe = builder . ProjectBuilder ( "TestProject1" , ProjectProtection . Unprotected )
69
74
. AddComponent ( "IView" , ComponentType . ClassModule , interfaceCode )
75
+ . AddComponent ( "MyModel" , ComponentType . ClassModule , modelCode )
70
76
. AddComponent ( "MyForm" , ComponentType . UserForm , implementationCode )
71
77
. MockVbeBuilder ( ) . Build ( ) ;
72
78
0 commit comments