public void MessageWithoutParam() { NickCommand nick = new NickCommand(); try { String message = nick.Message; Assert.Fail("Invalid message"); } catch(InvalidOperationException) { } catch { Assert.Fail("Invalid exception"); } }
public void PartiallyCorrectNick() { NickCommand nick = new NickCommand(); try { nick.Nick = "xpto+xpto"; Assert.Fail(); } catch(ArgumentException) { } catch { Assert.Fail(); } }
public void InvalidNick() { NickCommand nick = new NickCommand(); try { nick.Nick = "ç"; Assert.Fail("Should throw exception"); } catch(ArgumentException) { } catch { Assert.Fail("Incorrect exception"); } }
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"); } }
public void OldNick() { NickCommand nickCommand = new NickCommand(); nickCommand.OldNick = "Xpto"; Assert.AreEqual("Xpto", nickCommand.OldNick); }
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(); } }
public void SetNick() { NickCommand nick = new NickCommand(); nick.Nick = "Xpto"; }