Exemplo n.º 1
0
        public async Task UpdateUserAsync_SuccessfulUpdateOfUser_ReturnOk()
        {
            // Arrange
            var user = new User
            {
                Login           = "******",
                FirstName       = "FirstNameValueUpdate",
                LastName        = "LastNameValueUpdate",
                DisplayName     = "DisplayNameValueUpdate",
                Email           = "*****@*****.**",
                Source          = UserGroupSource.Database,
                AllowFallback   = false,
                Enabled         = true,
                ExpirePassword  = true,
                Password        = "******",
                UserSALT        = Guid.NewGuid(),
                Title           = "TitleValue",
                Department      = "DepartmentvalueUpdate",
                GroupMembership = new int[] { 1 },
                Guest           = false,
                CurrentVersion  = 1
            };
            var cxn        = new SqlConnectionWrapperMock();
            var repository = new SqlUserRepository(cxn.Object, cxn.Object);
            var errorId    = 1;

            cxn.SetupExecuteAsync("UpdateUser", It.IsAny <Dictionary <string, object> >(), 1, new Dictionary <string, object> {
                { "ErrorCode", errorId }
            });

            // Act
            await repository.UpdateUserAsync(user, null);

            // Assert
            cxn.Verify();
        }