I am trying to embrace TDD and started learning about mocking. I need some advice on what i should test and how to make my classes more behavioral and not simple data containers (with a bunch of getters/setters).
Consider this class.
public class Post
{
List<Comment> Comments {get; private set;}
public void AddComment(string message)
{
Comment.Add(new Comment(message));
}
}
An example of a state verification test would be
[Test]
public void CanAddCommentToPost()
{
Post p = new Post();
p.AddComment("AAAAA");
Assert.AreEqual(1, Comments.Count);
}
I', not exactly sure what i should be doing for behavioural verification, can someone provide some samples using Moq?