Exemple #1
0
 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"));
 }
Exemple #2
0
        public void Request_Parse_NoArgs()
        {
            var request = ProfileRequest.Parse("TEST:");

            Assert.Equal("TEST", request.Command);
            Assert.Empty(request.Args);
            Assert.Equal("TEST:", request.ToString());
        }
Exemple #3
0
        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());
        }