public void AddServiceBehaviorConflictingAttributesTest() { // Arrange List <Attribute> attributes = new List <Attribute> { new IncludedServiceBehaviorsAttribute(), new ExcludedServiceBehaviorsAttribute() }; var behaviors = new KeyedByTypeCollection <IServiceBehavior>(); var pluginBehaviors = new List <IServiceBehavior> { new ServiceBehavior1() }; // Act and Assert Assert.ThrowsException <ConflictingAttributesException>(() => ServiceBehaviorApplicator.AddServiceBehavior(attributes, behaviors, pluginBehaviors)); }
public void AddServiceBehaviorNullAttributesListTest() { // Arrange List <Attribute> attributes = null; var behaviors = new KeyedByTypeCollection <IServiceBehavior>(); var pluginBehaviors = new List <IServiceBehavior> { new ServiceBehavior1() }; // Act ServiceBehaviorApplicator.AddServiceBehavior(attributes, behaviors, pluginBehaviors); // Assert Assert.AreEqual(behaviors[0], pluginBehaviors[0]); }
public void AddServiceBehaviorIsExcludedByTypeAttributesTest() { // Arrange List <Attribute> attributes = new List <Attribute> { new ExcludedServiceBehaviorTypesAttribute(ServiceBehaviorType.Authenticator) }; var behaviors = new KeyedByTypeCollection <IServiceBehavior>(); var pluginBehaviors = new List <IServiceBehavior> { new ServiceBehavior1() }; // Act ServiceBehaviorApplicator.AddServiceBehavior(attributes, behaviors, pluginBehaviors); // Act and Assert Assert.AreEqual(0, behaviors.Count); }