public async Task RegisterUser_DbContextReceivedAddUser_UserCredentialsCorrect(string email, string password) { var pwd = password.ConvertToSecureString(); await _dbQuerier.RegisterUserTask(email, pwd); await _fakeDbContext.Received() .AddUser(Arg.Is <User>(u => u.Email == email && u.Password == password)); }
public async Task GetUser_UserFromDbConverted_UserReturnedCorrectly(string email, string password) { var pwd = password.ConvertToSecureString(); _fakeDbContext.GetUser(Arg.Any <string>(), Arg.Any <string>()) .Returns(new User() { Email = email, Password = password }); await _dbQuerier.RegisterUserTask(email, pwd); var userResult = await _dbQuerier.GetUserTask(email, pwd); Assert.That(userResult.Email, Is.EqualTo(email)); }
public async Task CreateUser_UserCreatedInDb_EmailCorrect(string email, string password) { var pwd = password.ConvertToSecureString(); await _dbQuerier.RegisterUserTask(email, pwd); using (var db = (AppDbContext)_dbContextFactory.GetContext()) { var anyUser = await db.Users.AnyAsync(); Assert.That(anyUser); } }