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));
        }
示例#2
0
        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));
        }
示例#3
0
        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);
            }
        }