Commit Graph
16 Commits
Author SHA1 Message Date
Pablo Ruiz Garcia 3ab03bc826 Fix style to adhere to mono's coding guidelines. 2012-11-29 17:00:21 +01:00
Pablo Ruiz Garcia 3ce598d0a1 Fixed routes with CatchAll argument, in order to make them succesfully
match requests with empty (or null) catch-all portion.

Included a couple of unit-tests which pass both here, and on ms.net land.

License: This patch is under MIT/X11 license.
2012-11-29 15:46:49 +01:00
Pablo Ruiz Garcia 4c066fa286 Fixes xamarin-bug #8646: Inconsistencies with MS.NET on Sys.Web.Routing logic.
This patch fixes some inconsistencies on Sys.Web.Routing between our implementation
and the one found on MS.NET.. Both relating to URL Generation code inside of
Route.GetVirtualPath().

1) When defining a route with a parameter with both a default value and some
constraint, Route.GetVirtualPath() fails to match if no parameter values is specified.

2) HttpMethodConstraint, does not take into account RouteDirection.UrlGeneration.

See: https://bugzilla.xamarin.com/show_bug.cgi?id=8646
License: This patch is under MIT/X11 license.
2012-11-29 01:33:55 +01:00
Marek Habersack cb4836ed8f 2010-05-05 Marek Habersack <[email protected]>
* RouteValueDictionary.cs: do not process type fields in
	RouteValueDictionary (object)

	* RouteCollection.cs: GetRouteData throws an exception if Request
	is null in the passed context.
	Added Ignore* and MapPageRoute* 4.0 APIs

	* RequestContext.cs: 4.0 API update

	* PatternParser.cs: match parser rewrite to encompass 4.0 bug
	fixes. We don't emulate some of the pre-4.0 routing bugs anymore.

svn path=/trunk/mcs/; revision=156695
2010-05-05 00:43:57 +00:00
Marek Habersack adba453b57 2009-06-25 Marek Habersack <[email protected]>
* RouteCollectionTest.cs, RouteTest.cs: added new tests for
	GetVirtualPath

2009-06-25  Marek Habersack  <[email protected]>

	* PatternParser.cs: parameter name lookups must be
	case-insensitive.
	Null and empty (string) parameters are skipped when building query
	part of the action path.

2009-06-25  Marek Habersack  <[email protected]>

	* LinqDataSource.cs: make ContextType not throw an exception when
	ContextTypeName is not set, but rather return a null in that
	case.

2009-06-25  Marek Habersack  <[email protected]>

	* MetaTableTest.cs: new GetVirtualPath tests.

	* DynamicDataRouteTest.cs: added tests for route.Defaults
	modifications on class init.

	* DynamicDataRouteHandlerTest.cs: added

2009-06-25  Marek Habersack  <[email protected]>

	* MetaTable.cs: Fixes to make tests succeed.

	* MetaModel.cs: added the GetDataFieldAttributes method for
	retrieving attributes associated with data type/field.
	Fixes to make tests succeed.

	* MetaColumn.cs: refactoring - use
	MetaModel.GetDataFieldAttributes instead of the local version.

	* DynamicDataRouteHandler.cs: implemented GetRequestContext,
	GetRequestMetaTable.

	* DynamicDataRoute.cs: when the Action and Table properties are
	set before one of GetVirtualPath or GetRouteData methods are
	called for the first time, a check is made whether the Defaults
	collection exists and whether it contains entries for Action and
	Table. Initialization code makes sure those entries are inserted
	into the dictionary in those cases.

svn path=/trunk/mcs/; revision=136875
2009-06-25 19:35:20 +00:00
Marek Habersack fed07c12c0 2009-06-04 Marek Habersack <[email protected]>
* RouteValueDictionaryExtensions.cs: if both values are strings in
	Has (string, value), compare them case-insensitively. Fixes bug
	#502555

2009-06-04  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added two more test cases to the bug
	#502555 test. They check whether url generation matches defaults
	case-insensitively.

svn path=/trunk/mcs/; revision=135438
2009-06-04 15:31:02 +00:00
Marek Habersack 9de8e1df99 2009-05-27 Marek Habersack <[email protected]>
* Makefile (LIB_MCS_FLAGS): added support for defining the DEBUG
	symbol on compiler command line.

2009-05-27  Marek Habersack  <[email protected]>

	* PatternParser.cs: if Match is passed an empty path, do not
	attempt to match the Url segments, skip to defaults matching right
	away.

2009-05-27  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added a test for routes from
	NerdDinner.

svn path=/trunk/mcs/; revision=134877
2009-05-27 20:53:58 +00:00
Marek Habersack e0f0a9dd5c 2009-05-25 Marek Habersack <[email protected]>
* UrlPattern.cs: removed - replaced by PatternParser below.

	* RouteValueDictionaryExtensions.cs: added - some shortcuts for
	using RouteValueDictionary in PatternParser

	* Route.cs: use the new PatternParser.
	Factored out ProcessConstraint into ProcessConstraintInternal so
	that the latter can be used by the PatternParser class.
	Added parameter checks in ProcessConstraint.

	* PatternTokenType.cs: added

	* PatternToken.cs: added a helper class for the pattern parser.

	* PatternParser.cs: added. New implementation of url
	parser/matcher/generator which fixes all URL isues known so
	far. Fixes bug #504378

2009-05-25  Marek Habersack  <[email protected]>

	* System.Web.Routing_test.dll.sources: added
	System.Web.Routing/AssertExtensions.cs

	* System.Web.Routing.dll.sources: added
	System.Web.Routing/PatternParser.cs
	System.Web.Routing/PatternToken.cs
	System.Web.Routing/PatternTokenType.cs
	System.Web.Routing/RouteValueDictionaryExtensions.cs

	removed
	System.Web.Routing/UrlPattern.cs

2009-05-25  Marek Habersack  <[email protected]>

	* RouteTest.cs: added several tests for GetVirtualPath,
	GetRouteData, ProcessConstraint and refactored some tests.

	* RouteCollectionTest.cs: added several tests for GetVirtualPath

	* AssertExtensions.cs: added some methods to make code testing for
	exception throws look nicer.

svn path=/trunk/mcs/; revision=134682
2009-05-25 12:38:37 +00:00
Gonzalo Paniagua Javier 3ca2cb0516 fix test
svn path=/trunk/mcs/; revision=134029
2009-05-13 00:43:10 +00:00
Marek Habersack d219fb0b28 2009-05-12 Marek Habersack <[email protected]>
* UrlPattern.cs: The
	value comparison is done case-insensitively when the dictionary
	values are strings. Fixes bug #502555

svn path=/trunk/mcs/; revision=133997
2009-05-12 21:51:01 +00:00
Marek Habersack 93e9f216e1 2009-05-11 Marek Habersack <[email protected]>
* UrlPattern.cs: TrySubstitute treats defaults differently
	now. They are not consulted when checking if the passed values
	match the pattern, but only when substituting the values. Fixes
	bug #502555

2009-05-11  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added test for bug #502555

svn path=/trunk/mcs/; revision=133904
2009-05-11 17:12:11 +00:00
Atsushi Eno acfe2986ae RouteCollection.RouteExistingFiles support.
svn path=/trunk/mcs/; revision=113452
2008-09-18 18:35:32 +00:00
Atsushi Eno 64a00cfead ongoing UrlRoutingModule implementation and tests.
svn path=/trunk/mcs/; revision=113265
2008-09-17 09:37:25 +00:00
Atsushi Eno 8acac8067d Route.GetRouteData() and HttpMethodConstraint.Match() with tests.
svn path=/trunk/mcs/; revision=112896
2008-09-12 18:02:55 +00:00
Atsushi Eno 1c1ab5802c Url parser implementation and some tests.
svn path=/trunk/mcs/; revision=112830
2008-09-12 09:37:37 +00:00
Atsushi Eno 17db992fad some implementations and tests.
svn path=/trunk/mcs/; revision=112761
2008-09-11 14:38:17 +00:00