示例#1
0
        public void Same_NickColor_should_be_equal()
        {
            Color c1 = ola.RGB;
            Color c2 = new NickColor("ola").RGB;

            AssertRGBEqual(c1, c2);
        }
示例#2
0
 public void NickColor_should_not_be_black()
 {
     NickColor nc = new NickColor("ola");
     Color c = nc.RGB;
     Assert.That(c.A, Is.EqualTo(255));
     AssertRGBNotEqual(c, Color.Black);
     AssertRGBNotEqual(c, Color.White);
 }
示例#3
0
        public void NickColor_should_not_be_black()
        {
            NickColor nc = new NickColor("ola");
            Color     c  = nc.RGB;

            Assert.That(c.A, Is.EqualTo(255));
            AssertRGBNotEqual(c, Color.Black);
            AssertRGBNotEqual(c, Color.White);
        }
示例#4
0
        public void Nearly_identical_names_should_have_unqique_hashes()
        {
            var name1 = new NickColor("manheusntahoesuntasnoeuhsntahoeusnthaosnetasuteuhnsaotheunsatoheusn");
            var name2 = new NickColor("manheusntahoesuntasnoeuhsntahoeusnthaosnetasuteuhnsaotheunsatoheusx");
            Assert.That(name1.Hash, Is.Not.EqualTo(name2.Hash));

            var name3 = new NickColor("abc");
            var name4 = new NickColor("abd");
            Assert.That(name3.Hash, Is.Not.EqualTo(name4.Hash));
        }
示例#5
0
        public void Nearly_identical_names_should_have_unqique_hashes()
        {
            var name1 = new NickColor("manheusntahoesuntasnoeuhsntahoeusnthaosnetasuteuhnsaotheunsatoheusn");
            var name2 = new NickColor("manheusntahoesuntasnoeuhsntahoeusnthaosnetasuteuhnsaotheunsatoheusx");

            Assert.That(name1.Hash, Is.Not.EqualTo(name2.Hash));

            var name3 = new NickColor("abc");
            var name4 = new NickColor("abd");

            Assert.That(name3.Hash, Is.Not.EqualTo(name4.Hash));
        }
示例#6
0
        public string ToHTML()
        {
            var divClass = "";
            if (post.Nick == Model.Server.User.Nick) {
                divClass = " class=\"me\"";
            }

            NickColor nc = new NickColor(post.Nick);

            return
            "<div" + divClass + @">
            <span class=""time"">" + post.Time.ToShortTimeString() + @"</span>
            <span class=""user"" style=""color: " + ColorTranslator.ToHtml(nc.RGB) + "\">" + post.Nick + @"</span>
            <span class=""text"">
            <p>
            " + post.Post.Replace("\n", "<br/>\n") + @"
            </p>
            </span>
            </div>
            ";
        }
示例#7
0
        public string ToHTML()
        {
            var divClass = "";

            if (post.Nick == Model.Server.User.Nick)
            {
                divClass = " class=\"me\"";
            }

            NickColor nc = new NickColor(post.Nick);

            return
                ("<div" + divClass + @">
	<span class=""time"">"     + post.Time.ToShortTimeString() + @"</span>
	<span class=""user"" style=""color: "     + ColorTranslator.ToHtml(nc.RGB) + "\">" + post.Nick + @"</span>
	<span class=""text"">
		<p>
			"             + post.Post.Replace("\n", "<br/>\n") + @"
		</p>
	</span>
</div>
");
        }
示例#8
0
 public void Same_NickColor_should_be_equal()
 {
     Color c1 = ola.RGB;
     Color c2 = new NickColor("ola").RGB;
     AssertRGBEqual(c1, c2);
 }
示例#9
0
        public User(MessageEventArgs_302310 message)
        {
            SetUserInformation(message);

            Color =  new NickColor(Nick).RGB;
        }
示例#10
0
        /// <summary>Updates this user with the information given in the message.</summary>
        /// <param name="message"></param>
        public void OnStatusChangedMessage(MessageEventArgs_304 message)
        {
            if (message.UserId != userId) {
                throw new ApplicationException("The user from the given " +
                                               "message ('" + message + "') did not match the current " +
                                               "user ('" + this + "')");
            }

            userId = message.UserId;
            idle = message.Idle;
            admin = message.Admin;
            icon = message.Icon;
            nick = message.Nick;
            status = message.Status;

            Color = new NickColor(nick).RGB;

            if (Updated != null) {
                Updated(this);
            }
        }