public void Request_ParseFailure() { Assert.Throws <ArgumentNullException>(() => ProfileRequest.Parse(null)); Assert.Throws <ArgumentNullException>(() => ProfileRequest.Parse(string.Empty)); Assert.Throws <FormatException>(() => ProfileRequest.Parse("TEST")); Assert.Throws <FormatException>(() => ProfileRequest.Parse("TEST: arg")); }
public void Request_Parse_NoArgs() { var request = ProfileRequest.Parse("TEST:"); Assert.Equal("TEST", request.Command); Assert.Empty(request.Args); Assert.Equal("TEST:", request.ToString()); }
public void Request_Parse_WithArgs() { var request = ProfileRequest.Parse("TEST: arg1=1, arg2=2"); Assert.Equal("TEST", request.Command); Assert.Equal(2, request.Args.Count); Assert.Equal("1", request.Args["arg1"]); Assert.Equal("2", request.Args["arg2"]); Assert.Equal("TEST: arg1=1, arg2=2", request.ToString()); }