public void SendMessage_MessageEmptyWithNicknames_ThrowsException() { var user = new StubIServiceUser() { NicknameGet = () => { return(properNickname); } }; service.AddUser(user); service.SendMessage(user.NicknameGet(), user.NicknameGet(), String.Empty, String.Empty); }
public void GetUser_UserDoesNotExists_ReturnsNull() { var user = new StubIServiceUser() { NicknameGet = () => { return(properNickname); } }; Assert.AreEqual(service.GetUser(user.NicknameGet()), null); }
public void SendMessage_SecondEmptyNickname_ThrowsException() { var user = new StubIServiceUser() { NicknameGet = () => { return(properNickname); } }; service.AddUser(user); service.SendMessage(user.NicknameGet(), String.Empty, subject, content); }
public void GetUser_UserExists_ReturnsUser() { var user = new StubIServiceUser() { NicknameGet = () => { return(properNickname); } }; service.AddUser(user); Assert.AreEqual(service.GetUser(user.NicknameGet()), user); }
public void SendMessage_ExistingNicknames_AddsMessageToInbox() { var user1 = new StubIServiceUser() { NicknameGet = () => { return(properNickname); }, PasswordGet = () => { return(properPassword); }, SentGet = () => { return(new List <IServiceMessage>()); }, InboxGet = () => { return(new List <IServiceMessage>()); } }; var user = new StubIServiceUser() { NicknameGet = () => { return(properNickname1); }, PasswordGet = () => { return(properPassword); }, SentGet = () => { return(new List <IServiceMessage>()); }, InboxGet = () => { return(new List <IServiceMessage>()); } }; service.AddUser(user1); service.AddUser(user); service.SendMessage(user1.NicknameGet(), user.NicknameGet(), subject, content); StringAssert.Equals(service.Messages[0].Subject, subject); }