public void UserServiceRegisterEmailIsNullFailTest() { var repoMock = new Mock <IRepository <User> >(); repoMock.Setup(m => m.GetAll()) .Returns(() => new List <User> { new User("John", "Doe"), new User("Steve", "Jobs"), new User("Bill", "Gates"), }); var service = new UserService(repoMock.Object); var login = ""; var password = "******"; var user = service.Register(login, password); Assert.Equal("EmailIsNull", user); }
public void UserServiceRegisterPasswordTooShortOkTest() { var repoMock = new Mock <IRepository <User> >(); repoMock.Setup(m => m.GetAll()) .Returns(() => new List <User> { new User("John", "Doe"), new User("Steve", "Jobs"), new User("Bill", "Gates"), }); var service = new UserService(repoMock.Object); var login = "******"; var password = "******"; var user = service.Register(login, password); Assert.Equal("OK", user); }