OpenAPI.NET.OData/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiInfoGeneratorTests.cs
2018-08-08 10:18:01 -07:00

39 lines
1.1 KiB
C#

// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// ------------------------------------------------------------
using System;
using Microsoft.OpenApi.OData.Edm;
using Microsoft.OpenApi.OData.Tests;
using Xunit;
namespace Microsoft.OpenApi.OData.Generator.Tests
{
public class OpenApiInfoGeneratorTest
{
[Fact]
public void CreateInfoThrowArgumentNullContext()
{
// Arrange
ODataContext context = null;
// Act & Assert
Assert.Throws<ArgumentNullException>("context", () => context.CreateInfo());
}
[Fact]
public void CreateInfoReturnsNotNullForEmptyModel()
{
// Arrange
ODataContext context = new ODataContext(EdmModelHelper.EmptyModel);
// Act
var info = context.CreateInfo();
// Assert
Assert.NotNull(info);
}
}
}