예제 #1
0
        public void UpdateUserList_Test1()
        {
            IrbisConnection connection = Connection.ThrowIfNull();

            UserInfo[] oldUsers    = connection.ListUsers();
            UserInfo   tylerDurden = new UserInfo
            {
                Name      = "TylerDurden",
                Password  = "******" + DateTime.Now.Ticks,
                Cataloger = "tyler.ini"
            };

            List <UserInfo> newUsers = oldUsers
                                       .Where(user => user.Name != "TylerDurden")
                                       .ToList();

            newUsers.Add(tylerDurden);

            connection.UpdateUserList(newUsers.ToArray());

            Write
            (
                string.Join
                (
                    ", ",
                    oldUsers.Select(u => u.Name).ToArray()
                )
            );

            Write
            (
                " | was: {0}, now: {1}",
                oldUsers.Length,
                newUsers.Count
            );
        }