public void Get_Should_Fetch_LocalGroup_When_HasNot_AssignedMembers()
        {
            // arrange
            string groupName = _generator.RandomName;

            _groupInstaller.Install(groupName);

            // act
            var group = _shell.Get(groupName);

            // assert
            group.Name.Should().Be(groupName);
            group.Members.Should().BeEmpty();
            group.Description.Should().Be(_groupInstaller.Description);
        }
        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);
        }
Beispiel #3
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();
        }
Beispiel #4
0
        public void Remove_DeletesGroup_Test()
        {
            // arrange
            var name = _generator.RandomName;

            _installer.Install(name);

            // act
            _shell.Remove(name);

            // assert
            var group = LocalGroupHelper.GetGroup(name);

            group.Should().BeNull();
        }