Telerik JustMock
[TestMethod]
public
void
ShouldAssertNestedPropertyGet()
{
var expected = 10;
// ARRANGE
// Creating a mocked instance of the "IFoo" interface.
var foo = Mock.Create<IFoo>();
// Arranging: When foo.Bar.Value is called, it should return expected value.
// This will automatically create mock of foo.Bar
// and a NullReferenceException will be avoided.
Mock.Arrange(() => foo.Bar.Value).Returns(expected);
// ACT
var actual = foo.Bar.Value;
// ASSERT
Assert.AreEqual(expected, actual);
}