You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
eglib
external
Lucene.Net.Light
Newtonsoft.Json
aspnetwebstack
packages
src
test
Microsoft.TestCommon
Microsoft.Web.Helpers.Test
Microsoft.Web.Http.Data.Test
Microsoft.Web.Mvc.Test
Microsoft.Web.WebPages.OAuth.Test
SPA.Test
System.Json.Test.Integration
System.Json.Test.Unit
System.Net.Http.Formatting.Test.Integration
System.Net.Http.Formatting.Test.Unit
System.Web.Helpers.Test
System.Web.Http.Integration.Test
ApiExplorer
Controllers
DocumentationProviders
Formatters
ApiExplorerSettingsTest.cs
DocumentationTest.cs
FormattersTest.cs
ParameterSourceTest.cs
RouteConstraintsTest.cs
RoutesTest.cs
Authentication
ContentNegotiation
Controllers
ExceptionHandling
ModelBinding
PartialTrust
Properties
Util
System.Web.Http.Integration.Test.csproj
packages.config
System.Web.Http.SelfHost.Test
System.Web.Http.Test
System.Web.Http.WebHost.Test
System.Web.Mvc.Test
System.Web.Razor.Test
System.Web.WebPages.Administration.Test
System.Web.WebPages.Deployment.Test
System.Web.WebPages.Razor.Test
System.Web.WebPages.Test
WebMatrix.Data.Test
WebMatrix.WebData.Test
Settings.StyleCop
tools
.gitattributes
.gitignore
License.txt
README.md
Runtime.msbuild
Runtime.sln
Runtime.xunit
Settings.StyleCop
build.cmd
binary-reference-assemblies
bockbuild
boringssl
buildtools
cecil
cecil-legacy
corefx
corert
ikdasm
ikvm
linker
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
ikvm-native
libgc
llvm
m4
man
mcs
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
65 lines
2.9 KiB
C#
65 lines
2.9 KiB
C#
![]() |
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
|
|||
|
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Net.Http;
|
|||
|
using System.Web.Http.Description;
|
|||
|
using System.Web.Http.Dispatcher;
|
|||
|
using Xunit.Extensions;
|
|||
|
|
|||
|
namespace System.Web.Http.ApiExplorer
|
|||
|
{
|
|||
|
public class ApiExplorerSettingsTest
|
|||
|
{
|
|||
|
public static IEnumerable<object[]> HiddenController_DoesNotShowUpOnDescription_PropertyData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
object controllerType = typeof(HiddenController);
|
|||
|
object expectedApiDescriptions = new List<object>();
|
|||
|
yield return new[] { controllerType, expectedApiDescriptions };
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[Theory]
|
|||
|
[PropertyData("HiddenController_DoesNotShowUpOnDescription_PropertyData")]
|
|||
|
public void HiddenController_DoesNotShowUpOnDescription(Type controllerType, List<object> expectedResults)
|
|||
|
{
|
|||
|
HttpConfiguration config = new HttpConfiguration();
|
|||
|
config.Routes.MapHttpRoute("Default", "{controller}/{id}", new { id = RouteParameter.Optional });
|
|||
|
|
|||
|
DefaultHttpControllerSelector controllerSelector = ApiExplorerHelper.GetStrictControllerSelector(config, controllerType);
|
|||
|
config.Services.Replace(typeof(IHttpControllerSelector), controllerSelector);
|
|||
|
|
|||
|
IApiExplorer explorer = config.Services.GetApiExplorer();
|
|||
|
ApiExplorerHelper.VerifyApiDescriptions(explorer.ApiDescriptions, expectedResults);
|
|||
|
}
|
|||
|
|
|||
|
public static IEnumerable<object[]> HiddenAction_DoesNotShowUpOnDescription_PropertyData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
object controllerType = typeof(HiddenActionController);
|
|||
|
object expectedApiDescriptions = new List<object>
|
|||
|
{
|
|||
|
new { HttpMethod = HttpMethod.Get, RelativePath = "HiddenAction/{id}", HasRequestFormatters = false, HasResponseFormatters = true, NumberOfParameters = 1}
|
|||
|
};
|
|||
|
yield return new[] { controllerType, expectedApiDescriptions };
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[Theory]
|
|||
|
[PropertyData("HiddenAction_DoesNotShowUpOnDescription_PropertyData")]
|
|||
|
public void HiddenAction_DoesNotShowUpOnDescription(Type controllerType, List<object> expectedResults)
|
|||
|
{
|
|||
|
HttpConfiguration config = new HttpConfiguration();
|
|||
|
config.Routes.MapHttpRoute("Default", "{controller}/{id}", new { id = RouteParameter.Optional });
|
|||
|
|
|||
|
DefaultHttpControllerSelector controllerSelector = ApiExplorerHelper.GetStrictControllerSelector(config, controllerType);
|
|||
|
config.Services.Replace(typeof(IHttpControllerSelector), controllerSelector);
|
|||
|
|
|||
|
IApiExplorer explorer = config.Services.GetApiExplorer();
|
|||
|
ApiExplorerHelper.VerifyApiDescriptions(explorer.ApiDescriptions, expectedResults);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|