public void PropertyName_NotSupportedException_WhenExpressionIsNotProperty()
 {
     var owner = new FakeOuterObject();
     var exception = Assert.Throws<NotSupportedException>(() =>
         owner.PropertyName(x => x.Method()));
     exception.ShouldNotBeNull();
 }
Esempio n. 2
0
        public void PropertyName_ReturnsDotSeparatedName_ForNestedProperty_ByDefault()
        {
            var owner        = new FakeOuterObject();
            var propertyName = owner.PropertyName(x => x.Inner.Property);

            propertyName.ShouldEqual("Inner.Property");
        }
Esempio n. 3
0
        public void PropertyName_ReturnsPropertyName()
        {
            var owner        = new FakeOuterObject();
            var propertyName = owner.PropertyName(x => x.Inner);

            propertyName.ShouldEqual("Inner");
        }
Esempio n. 4
0
        public void PropertyName_ReturnsNestedPropertyNameOnly_ForNestedProperty_WhenFullNameIsNotRequested()
        {
            var owner        = new FakeOuterObject();
            var propertyName = owner.PropertyName(x => x.Inner.Property, false);

            propertyName.ShouldEqual("Property");
        }
Esempio n. 5
0
        public void PropertyName_NotSupportedException_WhenExpressionIsNotProperty()
        {
            var owner     = new FakeOuterObject();
            var exception = Assert.Throws <NotSupportedException>(() =>
                                                                  owner.PropertyName(x => x.Method()));

            exception.ShouldNotBeNull();
        }
 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_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");
 }