public bool IsLoginRegistered(string email) { var key = GetKey(email); return(_storage .Get(key) .Convert(i => i.Logins.ContainsKey(email), false)); }
public void get_by_key_does_not_exist() { //GIVEN var result = _reader.Get(Guid.NewGuid()); //WHEN Assert.IsFalse(result.HasValue); }
public bool IsValidUser(GoalId goalId, string user) { Maybe <UserGoalsView> view; view = _reader.Get(goalId); if (!view.HasValue) { return(false); } return(view.Value.User.Equals(user)); }
Maybe <SessionIdentity> VerifyAndLoad(AuthInfo info) { var maybe = _view.Get(info.Login); if (!maybe.HasValue) { return(Maybe <SessionIdentity> .Empty); } var view = maybe.Value; // Stored token does not match actual token. // Crash this one if (!string.Equals(view.Token, info.Token)) { return(Maybe <SessionIdentity> .Empty); } return(new SessionIdentity(info.Login, view.Security, view.Display, info.ToCookieString(), view.Permissions, info.Token)); }
public async Task UpdateAnExistingDocument() { //Init var id = _sampleDocumentId; var existingDocument = _reader.Get(id); //Verify Assert.IsNotNull(existingDocument); var newCorrectAnswer = "Sample_Answer_" + Guid.NewGuid().ToString(); existingDocument.CorrectAnswer = newCorrectAnswer; //Action await _writer.CreateOrUpdateAsync(existingDocument); var document = await _reader.GetAsync(id); //Assert Assert.IsNotNull(document); Assert.AreEqual(newCorrectAnswer, document.CorrectAnswer); }
public List <CategoryDto> Get() { return(_reader.Get()); }
public List <QuestionDto> Get() { return(_reader.Get()); }