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); }
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>(); }
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); }