Example #1
0
 public void MessageWithoutParam()
 {
     NickCommand nick = new NickCommand();
     try
     {
         String message = nick.Message;
         Assert.Fail("Invalid message");
     }
     catch(InvalidOperationException)
     {
     }
     catch
     {
         Assert.Fail("Invalid exception");
     }
 }
Example #2
0
 public void PartiallyCorrectNick()
 {
     NickCommand nick = new NickCommand();
     try
     {
         nick.Nick = "xpto+xpto";
         Assert.Fail();
     }
     catch(ArgumentException)
     {
     }
     catch
     {
         Assert.Fail();
     }
 }
Example #3
0
 public void InvalidNick()
 {
     NickCommand nick = new NickCommand();
     try
     {
         nick.Nick = "ç";
         Assert.Fail("Should throw exception");
     }
     catch(ArgumentException)
     {
     }
     catch
     {
         Assert.Fail("Incorrect exception");
     }
 }
Example #4
0
 public void NickCantBeNull()
 {
     NickCommand nick = new NickCommand();
     try
     {
         nick.Nick = null;
         Assert.Fail("Should throw exception");
     }
     catch(ArgumentNullException exception)
     {
         Assert.AreEqual("Nick", exception.ParamName, "Incorrect parameter");
     }
     catch
     {
         Assert.Fail("Incorrect exception");
     }
 }
Example #5
0
 public void OldNick()
 {
     NickCommand nickCommand = new NickCommand();
     nickCommand.OldNick = "Xpto";
     Assert.AreEqual("Xpto", nickCommand.OldNick);
 }
Example #6
0
 public void ValidateParametersCantBeNull()
 {
     NickCommand nickCommand = new NickCommand();
     try
     {
         nickCommand.Validate("hello", null);
         Assert.Fail();
     }
     catch(ArgumentNullException exception)
     {
         Assert.AreEqual("parameters", exception.ParamName);
     }
     catch
     {
         Assert.Fail();
     }
 }
Example #7
0
 public void SetNick()
 {
     NickCommand nick = new NickCommand();
     nick.Nick = "Xpto";
 }