public void HostPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException() { // Arrange var mockHostProvider = MockHostProvider(); var criteria = new HostPersonalisationGroupCriteria(mockHostProvider.Object); // Act Assert.Throws <ArgumentNullException>(() => criteria.MatchesVisitor(null)); }
public void HostPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException() { // Arrange var mockHostProvider = MockHostProvider(); var criteria = new HostPersonalisationGroupCriteria(mockHostProvider.Object); // Act criteria.MatchesVisitor((string)null); }
public void HostPersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException() { // Arrange var mockHostProvider = MockHostProvider(); var criteria = new HostPersonalisationGroupCriteria(mockHostProvider.Object); var definition = "invalid"; // Act Assert.Throws <ArgumentException>(() => criteria.MatchesVisitor(definition)); }
public void HostPersonalisationGroupCriteria_ContainsVisitor_WithDefinitionForHostContains_WithMatchingValue_ReturnsTrue() { // Arrange var mockHostProvider = MockHostProvider(); var criteria = new HostPersonalisationGroupCriteria(mockHostProvider.Object); var definition = string.Format(DefinitionFormat, "example", "ContainsValue"); // Act var result = criteria.MatchesVisitor(definition); // Assert Assert.IsTrue(result); }
public void HostPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForHostDoesNotMatch_WithMatchingValue_ReturnsFalse() { // Arrange var mockHostProvider = MockHostProvider(); var criteria = new HostPersonalisationGroupCriteria(mockHostProvider.Object); var definition = string.Format(DefinitionFormat, "http://www.example.com/", "DoesNotMatchValue"); // Act var result = criteria.MatchesVisitor(definition); // Assert Assert.IsFalse(result); }