public void IfWhitespace() { Assert.Throws <DesignByContractViolationException>( () => Fail.IfWhitespace("", "message") ); Assert.Throws <DesignByContractViolationException>( () => Fail.IfWhitespace(null, "message") ); Assert.Throws <DesignByContractViolationException>( () => Fail.IfWhitespace(" ", "message") ); Fail.IfWhitespace("aa", "message"); }
private Uri PrepareRequestUri(string path, [CanBeNull] object?parameterToGet = null) { Fail.IfWhitespace(path, nameof(path)); var uriBuilder = new UriBuilder { Path = path.Replace("http://localhost/", ""), Host = HttpClient.BaseAddress.Host, Port = HttpClient.BaseAddress.Port }; if (parameterToGet != null) { uriBuilder.Query = QueryBuilder.Build(parameterToGet); } return(uriBuilder.Uri); }
public void IfWhitespaceWithMessageSuccess([NotNull] string text) { Fail.IfWhitespace(text, Violation.Of("it is whitespace")); }
public void IfWhitespaceWithMessage(string text) { Assert.Throws <DesignByContractViolationException>( () => Fail.IfWhitespace(text, Violation.Of("it is whitespace")) ); }
public void IfWhitespaceWithNameSuccess([NotNull] string text) { Fail.IfWhitespace(text, nameof(text)); }
public void IfWhitespaceWithName(string text) { Assert.Throws <DesignByContractViolationException>( () => Fail.IfWhitespace(text, nameof(text)) ); }