public void UpVote_IncrementsVote() { var post = new Post(_title, _description); int vote = post.Vote; post.UpVote(); Assert.AreEqual(vote + 1, post.Vote); }
public void Edit_UpdatesTitleAndDescription() { var post = new Post(_title, _description); post.Edit(_newTitle, _newDescription); Assert.AreEqual(_newTitle, post.Title); Assert.AreEqual(_newDescription, post.Description); }
public void Edit_SetsDateEdited() { var post = new Post(_title, _description); post.Edit(_newDescription); bool areSemiEqual = DateTimesAreSemiEqual(DateTime.Now, post.DateEdited, 1000); Assert.IsTrue(areSemiEqual); }
public void DownVote_DecrementsVote() { var post = new Post(_title, _description); int vote = post.Vote; post.DownVote(); Assert.AreEqual(vote - 1, post.Vote); }
static void Main(string[] args) { var post = new Post("I have a question", "bla bla..."); post.UpVote(); post.UpVote(); Console.WriteLine(post.DateCreated); Console.WriteLine(post.Vote); post.DownVote(); Console.WriteLine(post.Vote); post.Edit("bla bla bla..."); Console.WriteLine(post.Title + " - " + post.Description); Console.ReadKey(); }
public void Post_VoteIsInitiallyZero() { var post = new Post(_title, _description); Assert.AreEqual(0, post.Vote); }
public void Post_Creation_SetsTitleAndDescription() { var post = new Post(_title, _description); Assert.AreEqual(_title, post.Title); Assert.AreEqual(_description, post.Description); }
public void Post_Creation_SetsDateCreated() { var post = new Post(_title, _description); bool areSemiEqual = DateTimesAreSemiEqual(DateTime.Now, post.DateCreated, 1000); Assert.IsTrue(areSemiEqual); }