public void InstanceOutputAttrsAreSpecified_Returns_True_If_Instance_Method_Is_Overriden() { // act var resource = new InstanceFilteredResource(); // assert Assert.True(resource._instanceAttrsAreSpecified); }
public void Instance_Filter_Uses_NewExpression() { // arrange var model = new Model { AlwaysExcluded = "Joe" }; var resource = new InstanceFilteredResource(); // act var attrs = resource.GetOutputAttrs(model); // assert Assert.Empty(attrs); }
public void Instance_Filter_Uses_Member_Expression() { // arrange var model = new Model { AlwaysExcluded = "Admin" }; var resource = new InstanceFilteredResource(); // act var attrs = resource.GetOutputAttrs(model); // assert Assert.DoesNotContain(attrs, a => a.InternalAttributeName == nameof(Model.AlwaysExcluded)); }
public void Instance_Filter_Uses_Member_Expression() { // arrange var model = new Model { AlwaysExcluded = "Admin" }; var resource = new InstanceFilteredResource(); // act var attrs = resource.GetOutputAttrs(model); // assert Assert.Single(attrs); Assert.Equal(nameof(Model.Password), attrs[0].InternalAttributeName); }