/// <summary>
        /// Create a <see cref="OpenApiDocument"/>, it's a single Open API Object.
        /// </summary>
        /// <param name="context">The OData to Open API context.</param>
        /// <returns>The created <see cref="OpenApiDocument"/> object.</returns>
        public static OpenApiDocument CreateDocument(this ODataContext context)
        {
            Utils.CheckArgumentNull(context, nameof(context));

            // An OAS document consists of a single OpenAPI Object represented as OpenApiDocument object.
            // {
            //   "openapi":"3.0.0",
            //   "info": …,
            //   "servers": …,
            //   "tags": …,
            //   "paths": …,
            //   "components": …
            // }
            OpenApiDocument doc = new OpenApiDocument
            {
                Info = context.CreateInfo(),

                Servers = context.CreateServers(),

                //   Tags = context.CreateTags(),

                Paths = context.CreatePaths(),

                Components = context.CreateComponents(),

                SecurityRequirements = null,

                ExternalDocs = null
            };

            doc.Tags = context.CreateTags();

            return(doc);
        }
        public void CreateTagsThrowArgumentNullContext()
        {
            // Arrange
            ODataContext context = null;

            // Act & Assert
            Assert.Throws <ArgumentNullException>("context", () => context.CreateTags());
        }
        public void CreateTagsReturnsEmptyTagsForEmptyModel()
        {
            // Arrange
            ODataContext context = new ODataContext(EdmModelHelper.EmptyModel);

            // Act
            var tags = context.CreateTags();

            // Assert
            Assert.NotNull(tags);
            Assert.Empty(tags);
        }
        public void CreateTagsReturnsTagsForBasicModel()
        {
            // Arrange
            ODataContext context = new ODataContext(EdmModelHelper.BasicEdmModel);

            // Act
            var tags = context.CreateTags();

            // Assert
            Assert.NotNull(tags);
            Assert.Equal(4, tags.Count);
            Assert.Equal(new[] { "People", "City", "CountryOrRegion", "Me" }, tags.Select(t => t.Name));
        }
        public void CreateTagsReturnsTagsForTripModel()
        {
            // Arrange
            ODataContext context = new ODataContext(EdmModelHelper.TripServiceModel);

            // Act
            var tags = context.CreateTags();

            // Assert
            Assert.NotNull(tags);
            Assert.Equal(6, tags.Count);
            Assert.Equal(new[] { "People", "Airlines", "Airports", "NewComePeople", "Me", "ResetDataSource" },
                         tags.Select(t => t.Name));
        }