add some comments for Operation generater and change Tags unit test name

This commit is contained in:
Sam Xu 2017-11-29 13:40:49 -08:00
parent a29eed1d8e
commit 71e4f379c0
4 changed files with 9 additions and 2 deletions

View file

@ -668,6 +668,12 @@ namespace Microsoft.OpenApi.OData.Generator
return operation;
}
/// <summary>
/// Create a <see cref="OpenApiOperation"/> for a <see cref="IEdmOperationImport"/>.
/// </summary>
/// <param name="context">The OData context.</param>
/// <param name="operationImport">The Edm operation import.</param>
/// <returns>The created <see cref="OpenApiOperation"/>.</returns>
public static OpenApiOperation CreateOperation(this ODataContext context,
IEdmOperationImport operationImport)
{

View file

@ -51,6 +51,7 @@ namespace Microsoft.OpenApi.OData.Generator
var entityPathItem = context.CreateEntityPathItem(entitySet);
pathItems.Add(entityPathName, entityPathItem);
// bound operations to entity set or entity
foreach (var item in context.CreateOperationPathItems(entitySet))
{
pathItems.Add(item.Key, item.Value);
@ -63,6 +64,7 @@ namespace Microsoft.OpenApi.OData.Generator
var singletonPathItem = context.CreateSingletonPathItem(singleton);
pathItems.Add(singletonPathName, singletonPathItem);
// bound operations to singleton
foreach (var item in context.CreateOperationPathItems(singleton))
{
pathItems.Add(item.Key, item.Value);

View file

@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.OData.Edm;
using Microsoft.OpenApi.Models;

View file

@ -23,7 +23,7 @@ namespace Microsoft.OpenApi.OData.Generator.Tests
}
[Fact]
public void CreateTagsReturnsNullForEmptyModel()
public void CreateTagsReturnsEmptyTagsForEmptyModel()
{
// Arrange
ODataContext context = new ODataContext(EdmModelHelper.EmptyModel);