Пример #1
0
        public void Test_ActionDescription_GetApiVersion()
        {
            // Arrange
            ActionDescriptor description = null;
            var desc = new ActionDescriptor {
                Properties = new Dictionary <object, object>()
                {
                    { typeof(ApiVersionModel), new ApiVersionModel(new ApiVersion(1, 0)) }
                }
            };

            // Act
            var nullActionResult = description.GetApiVersion();
            var setActionResult  = desc.GetApiVersion();

            // Assert
            nullActionResult.Should().BeNull();
            setActionResult.Should().NotBeNull();
            setActionResult.DeclaredApiVersions[0].MajorVersion.Should().Be(1);
            setActionResult.DeclaredApiVersions[0].MinorVersion.Should().Be(0);
        }