public void GetNameMatchBehavior_ReturnsExact_WhenNoNameMatchBehaviorAttributeIsSpecified() { // Arrange var expected = ApiConventionNameMatchBehavior.Exact; var attributes = new object[] { new CLSCompliantAttribute(false), new ProducesResponseTypeAttribute(200) }; var provider = Mock.Of <ICustomAttributeProvider>(p => p.GetCustomAttributes(false) == attributes); // Act var result = ApiConventionResult.GetNameMatchBehavior(provider); // Assert Assert.Equal(expected, result); }
public void GetNameMatchBehavior_ReturnsExact_WhenNoAttributesArePresent() { // Arrange var expected = ApiConventionNameMatchBehavior.Exact; var attributes = new object[0]; var provider = Mock.Of <ICustomAttributeProvider>(p => p.GetCustomAttributes(false) == attributes); // Act var result = ApiConventionResult.GetNameMatchBehavior(provider); // Assert Assert.Equal(expected, result); }