示例#1
0
        public void HasAnyIdentifiers_ReturnsAsExpected(IEnumerable <string> source, IEnumerable <string> identifiers, bool expected)
        {
            //Arrange
            var sut = new PolicyTargetResource
            {
                Identifiers = source?.ToList()
            };

            //Act
            var result = sut.HasAnyIdentifiers(identifiers.ToList());

            //Assert
            result.ShouldBe(expected);
        }
示例#2
0
        public void HasAnyIdentifiers_WhenSourceIsNull_ThrowsArgumentNullExceptions()
        {
            //Arrange
            var sut = new PolicyTargetResource
            {
                Identifiers = null
            };

            //Act
            Action act = () => sut.HasAnyIdentifiers(new[] { PolicyTestData.Containers.Allowed });

            //Assert
            act.ShouldThrow <ArgumentNullException>();
        }
示例#3
0
        public void HasIdentifier_ReturnsAsExpected(string source, string identifier, bool expected)
        {
            //Arrange
            var sut = new PolicyTargetResource
            {
                Identifiers = new List <string> {
                    source
                }
            };

            //Act
            var result = sut.HasIdentifier(identifier);

            //Assert
            result.ShouldBe(expected);
        }