public void TryParse_Invalid() { WarningHeaderValue res; Assert.IsFalse(WarningHeaderValue.TryParse("", out res), "#1"); Assert.IsNull(res, "#2"); }
private void CheckValidTryParse(string input, WarningHeaderValue expectedResult) { WarningHeaderValue result = null; Assert.True(WarningHeaderValue.TryParse(input, out result)); Assert.Equal(expectedResult, result); }
private void CheckInvalidTryParse(string input) { WarningHeaderValue result = null; Assert.False(WarningHeaderValue.TryParse(input, out result)); Assert.Null(result); }
private void CheckInvalidParse(string input) { Assert.Throws <FormatException>(() => { WarningHeaderValue.Parse(input); }); Assert.False(WarningHeaderValue.TryParse(input, out WarningHeaderValue result)); Assert.Null(result); }
public void TryParse() { WarningHeaderValue res; Assert.IsTrue(WarningHeaderValue.TryParse("22 a \"b\"", out res), "#1"); Assert.IsNull(res.Date, "#2"); Assert.AreEqual(22, res.Code, "#3"); Assert.AreEqual("a", res.Agent, "#4"); Assert.AreEqual("\"b\"", res.Text, "#5"); }