New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected Behaviour with Parameterized Properties #293
Comments
@flandersen, thanks for mentioning this. I wonder if it's not the same underlying problem as in #277. |
Putting in the Backlog and marking as P2 for now. |
@blairconrad, thanks for your quick reply. Your workaround seems to work quite well. But I had to write <TestMethod>
Public Sub PropertiesWithStringParameter_ShouldntFailIfPropertyNotConfigured()
' Arange
Dim widthProperty As IHmiProperty = A.Fake(Of IHmiProperty)()
widthProperty.Name = "Width"
Dim properties As IHmiProperties = A.Fake(Of IHmiProperties)()
'' TODO: Delete when bug is fixed https://github.com/FakeItEasy/FakeItEasy/issues/293
A.CallTo(Function() faceplateTypical.Properties(A(Of String).Ignored)).ReturnsLazily(Function() A.Fake(Of IHmiProperty)())
''
A.CallTo(Function() properties.Properties("Width")).Returns(widthProperty)
' Act
properties.Properties("SomeOther").Name = "Dummy"
' Assert
Assert.AreEqual("Width", properties.Properties("Width").Name)
End Sub |
I'm glad to hear you have some relief. Of course, I still think we have an opportunity to improve the FakeItEasy indexed property handling. |
Marking as 2 - Working and enhancement (a closer look makes me think that indexed property support was never implemented, not that there's a flaw in the implementation) and assigning to me. |
@flandersen, thanks very much for raising this issue. Look for your name in the release notes. 🏆 This issue has been fixed in release 1.21.0. https://www.nuget.org/packages/FakeItEasy/1.21.0 |
Thanks Blair for the fix. Works great. Am 28.05.2014 um 11:55 schrieb Blair Conrad notifications@github.com:
|
Yay. I'm glad! |
This fails but it shouldn't:
I configured an object to be returned if the parameterized property is called with "Width". When you then call the property with another string you get another fake. That's ok. But if you call the property with "Width" again you don't get the correct fake, see VB.Net code below.
This behaviour doesn't appear when you change the property into a function.
The text was updated successfully, but these errors were encountered: