Skip to content

Commit

Permalink
Remove AutoExpand attribute of Friends, change Trips to be not null t…
Browse files Browse the repository at this point in the history
…o avoid WebApi query to throw ArgumentNullException.
  • Loading branch information
mirsking committed Aug 23, 2016
1 parent 29cc06f commit 28d7e25
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class TrippinInMemoryE2ETest : TrippinInMemoryE2ETestBase
// collection of navigation property with empty collection value
[InlineData("/People('willieashmore')/Friends", 200)]
// collection of navigation property with null collection value
// TODO since webapi doesnot handle query with null, the trips here in the datasource are actually not null.
[InlineData("/People('clydeguess')/Trips", 200)]
// collection of navigation property's property and navigation property has null value
// TODO should be bad request 400 as this is not allowed, 404 is returned by WebApi Route Match method. 500 is returned actually.
Expand Down Expand Up @@ -83,12 +84,6 @@ public void QueryPropertyWithNonExistEntity(string url, int expectedCode)
TestGetStatusCodeIs(url, expectedCode);
}

[Fact]
public void TestAutoExpandedNavigationProperty()
{
TestGetPayloadContains("People", "\"Friends\":[");
}

[Fact]
public void TestCollectionOfComplexPropertyAccess()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class Person

public Location HomeAddress { get; set; }

[AutoExpand]
public virtual ICollection<Person> Friends { get; set; }

public Person BestFriend { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ private void Initialize()
LastName = "Guess",
UserName = "clydeguess",
Gender = PersonGender.Male,
HomeAddress = new Location()
HomeAddress = new Location(),
Trips = new List<Trip>()
},
new Person()
{
Expand Down

0 comments on commit 28d7e25

Please sign in to comment.