public void BypassUrlPath_WithEmptyPath_ShouldThrowArgumentException() { MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc); Action testAction = () => { builder.BypassUrlPath(new PathString(), StringComparison.Ordinal);; }; testAction.ShouldThrow <ArgumentException>(); }
public void BypassUrlPath_WithNonEmptyPath_ValueShouldEqualInput() { const string urlPath = "/path"; MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc); builder.BypassUrlPath(new PathString(urlPath), StringComparison.Ordinal); builder.GetOptions() .GetSingleOrDefault <BypassUrlPathOption>() .ShouldNotBeNull() .Value.PathString.Value .ShouldBe(urlPath); }