Skip to content

Commit

Permalink
Fix element order in collection assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
AVTit committed Apr 28, 2020
1 parent e6b648f commit d9caa9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions XmlSchemaClassGenerator.Tests/XmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void TestListWithPublicPropertySetters()
Assert.NotNull(myClassType);
var iListType = typeof(Collection<>);
var collectionPropertyInfos = myClassType.GetProperties().Where(p => p.PropertyType.IsGenericType && iListType.IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition())).OrderBy(p=>p.Name).ToList();
var publicCollectionPropertyInfos = collectionPropertyInfos.Where(p => p.SetMethod.IsPublic).ToList();
var publicCollectionPropertyInfos = collectionPropertyInfos.Where(p => p.SetMethod.IsPublic).OrderBy(p=>p.Name).ToList();
Assert.True(collectionPropertyInfos.Count > 0);
Assert.Equal(collectionPropertyInfos, publicCollectionPropertyInfos);

Expand Down Expand Up @@ -205,7 +205,7 @@ public void TestListWithPublicPropertySettersWithoutConstructors()
Assert.NotNull(myClassType);
var iListType = typeof(Collection<>);
var collectionPropertyInfos = myClassType.GetProperties().Where(p => p.PropertyType.IsGenericType && iListType.IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition())).OrderBy(p=>p.Name).ToList();
var publicCollectionPropertyInfos = collectionPropertyInfos.Where(p => p.SetMethod.IsPublic).ToList();
var publicCollectionPropertyInfos = collectionPropertyInfos.Where(p => p.SetMethod.IsPublic).OrderBy(p=>p.Name).ToList();
Assert.True(collectionPropertyInfos.Count > 0);
Assert.Equal(collectionPropertyInfos, publicCollectionPropertyInfos);
var myClassInstance = Activator.CreateInstance(myClassType);
Expand Down

0 comments on commit d9caa9f

Please sign in to comment.