public void PropertyName_NotSupportedException_WhenExpressionIsNotProperty() { var owner = new FakeOuterObject(); var exception = Assert.Throws<NotSupportedException>(() => owner.PropertyName(x => x.Method())); exception.ShouldNotBeNull(); }
public void PropertyName_ReturnsDotSeparatedName_ForNestedProperty_ByDefault() { var owner = new FakeOuterObject(); var propertyName = owner.PropertyName(x => x.Inner.Property); propertyName.ShouldEqual("Inner.Property"); }
public void PropertyName_ReturnsPropertyName() { var owner = new FakeOuterObject(); var propertyName = owner.PropertyName(x => x.Inner); propertyName.ShouldEqual("Inner"); }
public void PropertyName_ReturnsNestedPropertyNameOnly_ForNestedProperty_WhenFullNameIsNotRequested() { var owner = new FakeOuterObject(); var propertyName = owner.PropertyName(x => x.Inner.Property, false); propertyName.ShouldEqual("Property"); }
public void PropertyName_NotSupportedException_WhenExpressionIsNotProperty() { var owner = new FakeOuterObject(); var exception = Assert.Throws <NotSupportedException>(() => owner.PropertyName(x => x.Method())); exception.ShouldNotBeNull(); }