public void AssignUsers_Should_Add_When_Memeber_Exist()
        {
            // arrange
            string groupName = _generator.RandomName;
            var    userName  = _generator.RandomName;

            _userInstaller.Install(userName, _generator.RandomName);
            _groupInstaller.Install(groupName);

            // act
            _shell.AssignUsers(groupName, new List <string> {
                userName
            });

            // assert
            var members = LocalGroupHelper.GetMemebers(groupName);

            members.Should().Contain(userName);
        }
Exemple #2
0
        public void RemoveUsers_Should_Remove_When_Memeber_Assigned()
        {
            // arrange
            string groupName = _generator.RandomName;
            var    userName  = _generator.RandomName;

            _userInstaller.Install(userName, _generator.RandomName);
            _groupInstaller.Install(groupName);

            LocalGroupHelper.AssignUser(groupName, userName);

            // act
            _shell.RemoveUsers(groupName, new List <string> {
                userName
            });

            // assert
            var members = LocalGroupHelper.GetMemebers(groupName);

            members.Should().BeEmpty();
        }