Exemplo n.º 1
0
        public async Task UpdateUserOnPasswordResetAsync_Success()
        {
            // Arrange
            var cxn        = new SqlConnectionWrapperMock();
            var repository = new SqlUserRepository(cxn.Object, cxn.Object);
            var user       = new AuthenticationUser
            {
                Login    = "******",
                Id       = 99,
                Password = "******",
                UserSalt = new Guid()
            };

            cxn.SetupExecuteAsync(
                "AddCurrentUserPasswordToHistory",
                new Dictionary <string, object>
            {
                { "@userId", user.Id }
            },
                1);

            cxn.SetupExecuteAsync(
                "UpdateUserOnPasswordResetAsync",
                new Dictionary <string, object>
            {
                { "@Login", user.Login },
                { "@Password", user.Password },
                { "@UserSALT", user.UserSalt }
            },
                1);

            // Act
            await repository.UpdateUserOnPasswordResetAsync(user);

            // Assert
            cxn.Verify();
        }