Ejemplo n.º 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);
        }
Ejemplo n.º 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>();
        }
Ejemplo n.º 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);
        }