Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public properties : Fixes public types to be upgrade safe so new content is not lost on deserialize and serialize paths. #2712

Merged
merged 13 commits into from
Sep 15, 2021
Prev Previous commit
Next Next commit
add test
  • Loading branch information
sourabh1007 committed Sep 15, 2021
commit 4c29cf33d0ed3d585c17187a1de1288062368490
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,24 @@ public void ContainerSettingsSimpleTest()
Assert.AreEqual(cosmosContainerSettings.PartitionKeyPath, collectionDeser.PartitionKey.Paths[0]);
}

[TestMethod]
public void ValidateAdditionalPropertiesAttributeInPropertiesFiles()
{
IEnumerable<Type> allClasses = from t in Assembly.GetAssembly(typeof(CosmosClient)).GetTypes()
where t.IsClass &&
t.IsPublic &&
!t.IsAbstract
where t.Name.EndsWith("Properties")
select t;

foreach(Type className in allClasses)
{
PropertyInfo property = className.GetProperty("AdditionalProperties", BindingFlags.NonPublic | BindingFlags.Instance);
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
Assert.IsTrue(property != null);
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
}
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

}

[TestMethod]
public void SettingsDeserializeWithAdditionalDataTest()
{
Expand Down