Add parameter to ignore querystrings when using Find.ByUrl
Brought to you by:
jvmenen
When using Find.ByUrl() you must currently provide the full url including querystring to make a match. Adding overloads with a bool parameter for ignoreQuery to Find.ByUrl(string) and Find.ByUrl(Uri) would allow people to ignore querystrings when appropriate without hurting compatibility to current code.
I have attached the code needed to make this happen including a unit test for the added functionality in UriComparer and additions to unit tests for the Find and Url changes.
Note: this functionality actually exists by using a regex for the compare instead of a Uri or a string but I wanted to be able to do this without a regex.
new FindBy.cs and unit test updates.
Logged In: YES
user_id=799177
Originator: NO
Will be in the next release
meanwhile (until the overload is implemented):
using System;
namespace Rubicon.Logistics.Web.Testing.Utilities
{
internal class StartsWithComparer : WatiN.Core.Comparers.StringComparer
{
public StartsWithComparer(string value) : base(value)
{
}
}