From 9fd938917ca5bd80fedccee4fd8ca2638e430bae Mon Sep 17 00:00:00 2001 From: "R. Tyler Ballance" Date: Mon, 14 Sep 2009 02:33:23 -0700 Subject: [PATCH] Update the printing format based on ##Proggit feedback, now printing ups and the direct reddit link --- source/Entry.cs | 12 ++++++++++++ source/Main.cs | 5 ++--- tests/ProggitTest.cs | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/Entry.cs b/source/Entry.cs index f5b51a5..f2ab11c 100644 --- a/source/Entry.cs +++ b/source/Entry.cs @@ -134,6 +134,18 @@ namespace Proggitbot set { this.id = value; } } + public Int64 Ups + { + get { return this.ups; } + set { this.ups = value; } + } + + public Int64 Downs + { + get { return this.downs; } + set { this.downs = value; } + } + public string Domain { get { return this.domain; } diff --git a/source/Main.cs b/source/Main.cs index f8ad3ef..9d6e6a6 100644 --- a/source/Main.cs +++ b/source/Main.cs @@ -51,9 +51,8 @@ namespace Proggitbot foreach (EntryData entry in entries) { - irc.SendMessage(SendType.Notice, channel, - String.Format("{0} ({1}) {2} {3}", entry.Title, entry.Author, - entry.Url, + irc.SendMessage(SendType.Message, channel, + String.Format("[+{0}/-{1}] {2} {3}", entry.Ups, entry.Downs, entry.Title, String.Format("http://reddit.com/comments/{0}", entry.Id) )); } diff --git a/tests/ProggitTest.cs b/tests/ProggitTest.cs index a195927..59dbe02 100644 --- a/tests/ProggitTest.cs +++ b/tests/ProggitTest.cs @@ -32,6 +32,8 @@ namespace Proggitbot.Tests Assert.AreEqual("scientologist2", data.Author, "Author mismatch"); Assert.AreEqual("ted.com", data.Domain, "Domain mismatch"); Assert.AreEqual("9k30b", data.Id, "ID mismatch"); + Assert.AreEqual(450, data.Ups, "Ups mismatch"); + Assert.AreEqual(97, data.Downs, "Downs mismatch"); } [Test]