public void RepositoryCalledWhenSaveMessageInvoked() { var message = "Message"; var username = "******"; var inputstring = string.Format("{0}:{1}", username, message); var userMessage = new UserMessage(username, message); subject = new MessagePoster(mockRespository.Object); subject.SaveMessage(inputstring); mockRespository.Verify(x => x.Save(It.IsAny <UserMessage>()), Times.Once); }