Approved
Last Updated: 13 Sep 2018 06:41 by ADMIN
ADMIN
Lyubomir Rusev
Created on: 12 Sep 2018 13:50
Type: Bug Report
1
Call to Arrange method wrongly mocks property used as parameter
A class property get wrongly mocked when used as parameter for arranging other class methods. The following sample demonstrates the scenario:

class Foo
{
	public string Prop{ get; set; }

	public void Bar(string val)
	{
	}
}

[TestMethod]
public void Sample()
{
	var sut = Mock.Create<Foo>(Behavior.CallOriginal);

	Mock.Arrange(() => sut.Bar(sut.Prop)).DoNothing();
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments