public void RepositoryCalledWhenGetUserMessageInvoked() { string userName = "******"; subject.GetUserMessages(userName); mockRespository.Verify(x => x.GetMessages(userName), Times.Once); }
public void ReturnsNoMessagesWhenForUnknownUsernameEntered() { mockRespository.Setup(x => x.GetMessages(It.IsAny <string>())).Returns(new List <Message>()); subject = new MessagePoster(mockRespository.Object); var messages = subject.GetUserMessages("joe bloggs"); Assert.AreEqual(0, messages.Count); }