Skip to content

Commit 755be96

Browse files
committed
Added tests for deprecation:
1) Deprecated Entity Type (entityType3) a) includes entity set of that type (testTypes) b) includes nav prop of that type (testEntity/testExplicitNav, singletonEntity2/testSingleNav2, refTypes) c) includes action bound to that type (forward) 2a) Deprecated Complex Type (responseObject) a) includes method that returns that type (query) 2b) Deprecated base Complex Type (emptyBaseComplexTypeRequest) a) includes derived type (derivedComplexTypeRequest) aa) includes property of the derived type (testType/PropertyAlpha) 3) Deprecation of enum type (enum1) a) includes properties of that type (derivedComplexTypeRequest)
1 parent 4bd1d00 commit 755be96

13 files changed

Lines changed: 63 additions & 3 deletions

File tree

test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,70 @@
1212
<Property Name="propertyAlpha" Type="graph.derivedComplexTypeRequest" />
1313
</EntityType>
1414
<EnumType Name="enum1">
15+
<Annotation Term = "Org.OData.Core.V1.Revisions">
16+
<Collection>
17+
<Record>
18+
<PropertyValue Property="Date" Date="2020-10-16"/>
19+
<PropertyValue Property="RemovalDate" Date="2021-01-15"/>
20+
<PropertyValue Property="Version" String="test"/>
21+
<PropertyValue Property = "Kind" EnumMember="Org.OData.Core.V1.RevisionKind/Deprecated"/>
22+
<PropertyValue Property = "Description" String="enum1 is deprecated. Please use string."/>
23+
</Record>
24+
</Collection>
25+
</Annotation>
1526
<Member Name="value0" Value="0" />
1627
<Member Name="value1" Value="1" />
1728
</EnumType>
18-
<ComplexType Name="emptyBaseComplexTypeRequest" Abstract="true" />
29+
<ComplexType Name="emptyBaseComplexTypeRequest" Abstract="true">
30+
<Annotation Term = "Org.OData.Core.V1.Revisions">
31+
<Collection>
32+
<Record>
33+
<PropertyValue Property="Date" Date="2020-10-16"/>
34+
<PropertyValue Property="RemovalDate" Date="2021-01-15"/>
35+
<PropertyValue Property="Version" String="test"/>
36+
<PropertyValue Property = "Kind" EnumMember="Org.OData.Core.V1.RevisionKind/Deprecated"/>
37+
<PropertyValue Property = "Description" String="emptyBaseComplexTypeRequest is deprecated. Please use emptyBaseComplexTypeRequest2."/>
38+
</Record>
39+
</Collection>
40+
</Annotation>
41+
</ComplexType>
1942
<ComplexType Name="derivedComplexTypeRequest" BaseType="graph.emptyBaseComplexTypeRequest">
2043
<Property Name="property1" Type="Edm.String" />
2144
<Property Name="property2" Type="Edm.String" />
2245
<Property Name="enumProperty" Type="graph.enum1" />
2346
</ComplexType>
24-
<ComplexType Name="responseObject" />
47+
<ComplexType Name="responseObject">
48+
<Annotation Term = "Org.OData.Core.V1.Revisions">
49+
<Collection>
50+
<Record>
51+
<PropertyValue Property="Date" Date="2020-10-16"/>
52+
<PropertyValue Property="RemovalDate" Date="2021-01-15"/>
53+
<PropertyValue Property="Version" String="test"/>
54+
<PropertyValue Property = "Kind" EnumMember="Org.OData.Core.V1.RevisionKind/Deprecated"/>
55+
<PropertyValue Property = "Description" String="responseObject is deprecated. Please use something else."/>
56+
</Record>
57+
</Collection>
58+
</Annotation>
59+
</ComplexType>
2560
<Action Name="query" IsBound="true">
2661
<Parameter Name="bindingParameter" Type="graph.testType" />
2762
<Parameter Name="requests" Type="Collection(graph.derivedComplexTypeRequest)" Nullable="false" />
2863
<ReturnType Type="Collection(graph.responseObject)" Nullable="false" />
2964
</Action>
3065
<EntityType Name="entityType2" BaseType="graph.entity" />
31-
<EntityType Name="entityType3" BaseType="graph.entity" />
66+
<EntityType Name="entityType3" BaseType="graph.entity">
67+
<Annotation Term = "Org.OData.Core.V1.Revisions">
68+
<Collection>
69+
<Record>
70+
<PropertyValue Property="Date" Date="2020-10-16"/>
71+
<PropertyValue Property="RemovalDate" Date="2021-01-15"/>
72+
<PropertyValue Property="Version" String="test"/>
73+
<PropertyValue Property = "Kind" EnumMember="Org.OData.Core.V1.RevisionKind/Deprecated"/>
74+
<PropertyValue Property = "Description" String="entityType3 is deprecated. Please use singletonEntity1."/>
75+
</Record>
76+
</Collection>
77+
</Annotation>
78+
</EntityType>
3279
<EntityType Name="testEntity" BaseType="graph.entity">
3380
<NavigationProperty Name="testNav" Type="graph.testType" />
3481
<NavigationProperty Name="testInvalidNav" Type="graph.entityType2" />

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/DerivedComplexTypeRequest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Graph
1818
/// <summary>
1919
/// The type DerivedComplexTypeRequest.
2020
/// </summary>
21+
[Obsolete("emptyBaseComplexTypeRequest is deprecated. Please use emptyBaseComplexTypeRequest2.")]
2122
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
2223
public partial class DerivedComplexTypeRequestObject : EmptyBaseComplexTypeRequestObject
2324
{
@@ -44,6 +45,7 @@ public DerivedComplexTypeRequestObject()
4445
/// <summary>
4546
/// Gets or sets enumProperty.
4647
/// </summary>
48+
[Obsolete("enum1 is deprecated. Please use string.")]
4749
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "enumProperty", Required = Newtonsoft.Json.Required.Default)]
4850
public Enum1? EnumProperty { get; set; }
4951

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/EmptyBaseComplexTypeRequest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Graph
1818
/// <summary>
1919
/// The type EmptyBaseComplexTypeRequest.
2020
/// </summary>
21+
[Obsolete("emptyBaseComplexTypeRequest is deprecated. Please use emptyBaseComplexTypeRequest2.")]
2122
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
2223
[JsonConverter(typeof(DerivedTypeConverter))]
2324
public abstract partial class EmptyBaseComplexTypeRequestObject

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/EntityType3.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Graph
1818
/// <summary>
1919
/// The type Entity Type3.
2020
/// </summary>
21+
[Obsolete("entityType3 is deprecated. Please use singletonEntity1.")]
2122
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
2223
public partial class EntityType3 : Entity
2324
{

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/Enum1.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Microsoft.Graph
1616
/// <summary>
1717
/// The enum Enum1.
1818
/// </summary>
19+
[Obsolete("enum1 is deprecated. Please use string.")]
1920
[JsonConverter(typeof(EnumConverter))]
2021
public enum Enum1
2122
{

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/ResponseObject.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Graph
1818
/// <summary>
1919
/// The type ResponseObject.
2020
/// </summary>
21+
[Obsolete("responseObject is deprecated. Please use something else.")]
2122
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
2223
[JsonConverter(typeof(DerivedTypeConverter))]
2324
public partial class ResponseObject

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/SingletonEntity2.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public SingletonEntity2()
3333
/// <summary>
3434
/// Gets or sets test single nav2.
3535
/// </summary>
36+
[Obsolete("entityType3 is deprecated. Please use singletonEntity1.")]
3637
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "testSingleNav2", Required = Newtonsoft.Json.Required.Default)]
3738
public EntityType3 TestSingleNav2 { get; set; }
3839

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/TestEntity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public TestEntity()
4545
/// <summary>
4646
/// Gets or sets test explicit nav.
4747
/// </summary>
48+
[Obsolete("entityType3 is deprecated. Please use singletonEntity1.")]
4849
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "testExplicitNav", Required = Newtonsoft.Json.Required.Default)]
4950
public EntityType3 TestExplicitNav { get; set; }
5051

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Model/TestType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public TestType()
3333
/// <summary>
3434
/// Gets or sets property alpha.
3535
/// </summary>
36+
[Obsolete("emptyBaseComplexTypeRequest is deprecated. Please use emptyBaseComplexTypeRequest2.")]
3637
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "propertyAlpha", Required = Newtonsoft.Json.Required.Default)]
3738
public DerivedComplexTypeRequestObject PropertyAlpha { get; set; }
3839

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/EntityType3ForwardRequest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Graph
1818
/// <summary>
1919
/// The type EntityType3ForwardRequest.
2020
/// </summary>
21+
[Obsolete("entityType3 is deprecated. Please use singletonEntity1.")]
2122
public partial class EntityType3ForwardRequest : BaseRequest, IEntityType3ForwardRequest
2223
{
2324
/// <summary>

0 commit comments

Comments
 (0)