public JsonResult Register(RegisterModel model) { Result <LoggedUserInfo> resultData = _dataService.Register(model); if (resultData.Data != null) { _userCache.AddOrUpdate(resultData.Data); return(new JsonResult(resultData.Data)); } return(new JsonResult(resultData.Error)); }
public void Login_AddsUserToLoggedInPool() { // Arrange var user = Substitute.For <IUser>(); user.Username = "******"; user.Password = "******"; // Act _uut.Login(user); // Assert Received.InOrder(() => { _fakeUserCache.AddOrUpdate(user.Username, user.Password); }); }
public void Login(IUser user) { _userCache.AddOrUpdate(user.Username, user.Password); }