public void Request_Filter_Uses_NewExpression()
        {
            // arrange
            var resource = new RequestFilteredResource(isAdmin: false);

            // act
            var attrs = resource.GetOutputAttrs(null);

            // assert
            Assert.Empty(attrs);
        }
Пример #2
0
        public void Request_Filter_Uses_Member_Expression()
        {
            // arrange
            var resource = new RequestFilteredResource(isAdmin: true);

            // act
            var attrs = resource.GetOutputAttrs(null);

            // assert
            Assert.DoesNotContain(attrs, a => a.InternalAttributeName == nameof(Model.AlwaysExcluded));
        }
        public void Request_Filter_Uses_Member_Expression()
        {
            // arrange
            var resource = new RequestFilteredResource(isAdmin: true);

            // act
            var attrs = resource.GetOutputAttrs(null);

            // assert
            Assert.Single(attrs);
            Assert.Equal(nameof(Model.Password), attrs[0].InternalAttributeName);
        }