@@ -1,13 +1,11 @@
Loading
1 1
using System;
2 -
using System.Collections.Generic;
3 2
using System.Linq;
4 -
using System.Text;
5 3
6 4
namespace TurnerSoftware.RobotsExclusionTools.Helpers
7 5
{
8 -
	public class PathComparisonUtility
6 +
	public static class PathComparisonUtility
9 7
	{
10 -
		public bool IsAllowed(SiteAccessEntry accessEntry, Uri requestUri)
8 +
		public static bool IsAllowed(SiteAccessEntry accessEntry, Uri requestUri)
11 9
		{
12 10
			var requestPath = requestUri.PathAndQuery;
13 11
@@ -38,14 +36,14 @@
Loading
38 36
			return true;
39 37
		}
40 38
41 -
		public bool PathMatch(string sourceRecord, string uriPath, StringComparison comparison)
39 +
		public static bool PathMatch(string sourceRecord, string uriPath, StringComparison comparison)
42 40
		{
43 41
			var sourcePieces = sourceRecord.Split(new[] { '*' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
44 42
			var lastPiece = sourcePieces.LastOrDefault();
45 43
			var mustMatchToEnd = false;
46 44
			var mustMatchToStart = true;
47 45
48 -
			if (lastPiece.EndsWith("$"))
46 +
			if (lastPiece != null && lastPiece.EndsWith("$"))
49 47
			{
50 48
				//Remove the last dollar sign from the last piece
51 49
				lastPiece = lastPiece.Substring(0, lastPiece.Length - 1);

@@ -53,8 +53,7 @@
Loading
53 53
			}
54 54
55 55
			var entry = GetEntryForUserAgent(userAgent);
56 -
			var pathComparisonUtility = new PathComparisonUtility();
57 -
			return pathComparisonUtility.IsAllowed(entry, uri);
56 +
			return PathComparisonUtility.IsAllowed(entry, uri);
58 57
		}
59 58
60 59
		public SiteAccessEntry GetEntryForUserAgent(string userAgent)
Files Coverage
src/TurnerSoftware.RobotsExclusionTools 96.06%
Project Totals (22 files) 96.06%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading