Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }