Exemplo n.º 1
0
        public async Task UpdateUserOnInvalidLoginAsync_CallsProcedureWithCorrectParameters()
        {
            // Arrange
            var cxn                 = new SqlConnectionWrapperMock();
            var repository          = new SqlUserRepository(cxn.Object, cxn.Object);
            AuthenticationUser user = new AuthenticationUser
            {
                Login     = "******",
                IsEnabled = true,
                InvalidLogonAttemptsNumber = 1,
                LastInvalidLogonTimeStamp  = new DateTime(0L)
            };

            cxn.SetupExecuteAsync(
                "UpdateUserOnInvalidLogin",
                new Dictionary <string, object>
            {
                { "Login", user.Login },
                { "Enabled", user.IsEnabled },
                { "InvalidLogonAttemptsNumber", user.InvalidLogonAttemptsNumber },
                { "LastInvalidLogonTimeStamp", user.LastInvalidLogonTimeStamp }
            },
                1);

            // Act
            await repository.UpdateUserOnInvalidLoginAsync(user);

            // Assert
            cxn.Verify();
        }