public void ShouldReturnFalse_IfNoContent(string content) { // arrange SocialNetwork socialNetwork = new SocialNetwork(); User user = new User("Tom", "Hughes"); // act bool result = socialNetwork.DoPost(content, user); // assert Assert.False(result); Assert.Empty(socialNetwork.allPosts); }
public void ShouldReturnFalse_IfNoUser() { // arrange SocialNetwork socialNetwork = new SocialNetwork(); string content = "exhilirating content"; // act bool result = socialNetwork.DoPost(content, null); // assert Assert.False(result); Assert.Empty(socialNetwork.allPosts); }
public void ShouldReturnTrue_IfPostSuccessful() { // arrange SocialNetwork socialNetwork = new SocialNetwork(); User user = new User("Tom", "Hughes"); string content = "Exciting content"; // act bool result = socialNetwork.DoPost(content, user); // assert Assert.True(result); Assert.Single(socialNetwork.allPosts); }