public void ProvideForActionFilter_OneDescriptorProviderThatReturn1AuthProvider_ReturnsEmptySet() { _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter), 1, null)); var filters = GetFilters <IActionFilter>(_filterProviderWith1DescProvider); filters.Should().NotBeNull(); filters.Should().BeEmpty(); }
public void ProvideForAuthFilter_OneWithFilterAndMatchingSkip_ReturnsEmptySet() { _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter), 1, null)); _descProvider.Descriptors.Add(FilterDescriptor.NewSkip(typeof(FakeAuthFilter))); var filters = GetFilters <IAuthorizationFilter>(_filterProviderWith1DescProvider); filters.Should().NotBeNull(); filters.Should().BeEmpty(); }
public void ProvideForAuthFilter_Ordering_ReturnsCorrectOrdering() { _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter2), 2, null)); _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter), 1, null)); var filters = GetFilters <IAuthorizationFilter>(_filterProviderWith1DescProvider); filters.Should().NotBeNull(); filters.Should().HaveCount(2); filters.ElementAt(0).Should().BeOfType <FakeAuthFilter>(); filters.ElementAt(1).Should().BeOfType <FakeAuthFilter2>(); }
public void ProvideForAuthFilter_MultipleFiltersWithOneMatchingSkip_ReturnsNonSkippedFilters() { _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter), 1, null)); _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter2), 2, null)); _descProvider.Descriptors.Add(FilterDescriptor.NewSkip(typeof(FakeAuthFilter))); var filters = GetFilters <IAuthorizationFilter>(_filterProviderWith1DescProvider); filters.Should().NotBeNull(); filters.Should().HaveCount(1); filters.ElementAt(0).Should().BeOfType <FakeAuthFilter2>(); }
public void Provide_OneDescriptorProviderThatReturn1AuthProvider_ReturnsAuthFilter() { _descProvider.Descriptors.Add(FilterDescriptor.NewIncludeType(typeof(FakeAuthFilter), 1, null)); var filters = GetFilters <IAuthorizationFilter>(_filterProviderWith1DescProvider); filters.Should().NotBeNull(); filters.Should().HaveCount(1); var filter = filters.ElementAt(0); filter.Should().NotBeNull(); filter.Should().BeOfType <FakeAuthFilter>(); }