-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for changing property type/accessibility (#4365)
- Loading branch information
1 parent
782dca5
commit 86cc361
Showing
3 changed files
with
116 additions
and
10 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
27 changes: 27 additions & 0 deletions
27
...ders/TestData/ModelCustomizationTests/TestCustomization_CanChangePropertyAccessibility.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,27 @@ | ||
#nullable disable | ||
|
||
using System; | ||
|
||
namespace Sample | ||
{ | ||
// TODO: if we decide to use the public APIs, we do not have to define this attribute here. Tracking: https://github.com/Azure/autorest.csharp/issues/4551 | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
internal class CodeGenMemberAttribute : Attribute | ||
{ | ||
public CodeGenMemberAttribute() : base(null) | ||
{ | ||
} | ||
|
||
public CodeGenMemberAttribute(string originalName) : base(originalName) | ||
{ | ||
} | ||
} | ||
} | ||
namespace Sample.Models | ||
{ | ||
public partial class MockInputModel | ||
{ | ||
[CodeGenMember("Prop1")] | ||
internal string[] Prop2 { get; set; } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...est/Providers/TestData/ModelCustomizationTests/TestCustomization_CanChangePropertyType.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,27 @@ | ||
#nullable disable | ||
|
||
using System; | ||
|
||
namespace Sample | ||
{ | ||
// TODO: if we decide to use the public APIs, we do not have to define this attribute here. Tracking: https://github.com/Azure/autorest.csharp/issues/4551 | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
internal class CodeGenMemberAttribute : Attribute | ||
{ | ||
public CodeGenMemberAttribute() : base(null) | ||
{ | ||
} | ||
|
||
public CodeGenMemberAttribute(string originalName) : base(originalName) | ||
{ | ||
} | ||
} | ||
} | ||
namespace Sample.Models | ||
{ | ||
public partial class MockInputModel | ||
{ | ||
[CodeGenMember("Prop1")] | ||
public int[] Prop2 { get; set; } | ||
} | ||
} |