-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enclosingType to InputModelProperty (#4221)
Contributes to #4091
- Loading branch information
1 parent
1fba540
commit d9faa2a
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...http-client-csharp/generator/Microsoft.Generator.CSharp.Input/test/InputModelTypeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Tests.Common; | ||
using NUnit.Framework; | ||
|
||
namespace Microsoft.Generator.CSharp.Input.Tests | ||
{ | ||
internal class InputModelTypeTests | ||
{ | ||
[Test] | ||
public void EnclosingTypeIsSet() | ||
{ | ||
var property = InputFactory.Property("prop1", InputPrimitiveType.Any, true, true); | ||
var model1 = InputFactory.Model("foo", "internal", usage: InputModelTypeUsage.Input, properties: [property]); | ||
Assert.AreEqual(model1, property.EnclosingType); | ||
|
||
var model2 = InputFactory.Model("bar", "internal", usage: InputModelTypeUsage.Input, properties: [property]); | ||
Assert.AreEqual(model2, property.EnclosingType); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...rator/Microsoft.Generator.CSharp.Input/test/Microsoft.Generator.CSharp.Input.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters