public void GetOrderedMetadata_CanReturnNonEmptyCollection()
        {
            // Arrange
            var metadata = new EndpointMetadataCollection("1", "2");

            // Act
            var ordered1 = metadata.GetOrderedMetadata <string>();
            var ordered2 = metadata.GetOrderedMetadata <string>();

            Assert.Same(ordered1, ordered2);
            Assert.Equal(new string[] { "1", "2" }, ordered1);
        }
        public void GetOrderedMetadata_CanReturnEmptyCollection()
        {
            // Arrange
            var metadata = new EndpointMetadataCollection(1, 2, 3);

            // Act
            var ordered = metadata.GetOrderedMetadata <string>();

            Assert.Same(Array.Empty <string>(), ordered);
        }
        public void GetOrderedMetadata_NoMatch_ReturnsEmpty()
        {
            // Arrange
            var items = new object[]
            {
                new Metadata3(),
                new Metadata3(),
                new Metadata3(),
            };

            var metadata = new EndpointMetadataCollection(items);

            // Act
            var result = metadata.GetOrderedMetadata <IMetadata5>();

            // Assert
            Assert.Empty(result);
        }
        public void GetOrderedMetadata_Match_ReturnsItemsInAscendingOrder()
        {
            // Arrange
            var items = new object[]
            {
                new Metadata1(),
                new Metadata2(),
                new Metadata3(),
            };

            var metadata = new EndpointMetadataCollection(items);

            // Act
            var result = metadata.GetOrderedMetadata <IMetadata5>();

            // Assert
            Assert.Collection(
                result,
                i => Assert.Same(items[0], i),
                i => Assert.Same(items[1], i));
        }