diff options
author | raghuramn <ranadimi@microsoft.com> | 2012-10-13 03:47:42 +0400 |
---|---|---|
committer | raghuramn <ranadimi@microsoft.com> | 2012-10-13 04:50:01 +0400 |
commit | e0115a823029e7f62cb36cd21992f8088a1aacc9 (patch) | |
tree | 32dc20178faaad838f58be69f028e8acaea612af | |
parent | fb7632d7eaf7121c58ef8e43371187de69dcfc83 (diff) |
cleanup disabled odata tests.
1) removing tests that are not relevant
2) enabling tests that are relevant and can run.
13 files changed, 300 insertions, 535 deletions
diff --git a/test/System.Web.Http.OData.Test/BaselineResource.Designer.cs b/test/System.Web.Http.OData.Test/BaselineResource.Designer.cs index c0210cc4..5dca918f 100644 --- a/test/System.Web.Http.OData.Test/BaselineResource.Designer.cs +++ b/test/System.Web.Http.OData.Test/BaselineResource.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.18003 +// Runtime Version:4.0.30319.18010 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -354,11 +354,11 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<ArrayOfboolean xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> + ///<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> /// <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">true</element> /// <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">false</element> /// <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">true</element> - /// <element m:type="Edm.Boole [rest of string was truncated]";. + /// <element m:type="Edm.Boolean" xm [rest of string was truncated]";. /// </summary> internal static string TestArrayOfBools { get { @@ -368,11 +368,11 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<ArrayOfint xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> + ///<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> /// <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">10</element> /// <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">20</element> /// <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">30</element> - /// <element m:type="Edm.Int32" xmlns:m="http:/ [rest of string was truncated]";. + /// <element m:type="Edm.Int32" xmlns:m="http://s [rest of string was truncated]";. /// </summary> internal static string TestArrayOfInts { get { @@ -382,14 +382,13 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<ArrayOfPerson xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> - /// <element m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> + ///<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + /// <element m:type="System.Web.Http.OData.TestCommon.Models.Person"> /// <Age m:type="Edm.Int32">20</Age> - /// <FavoriteHobby m:type="HobbyActivity"> - /// <ActivityName>Xbox Gaming</ActivityName> - /// </FavoriteHobby> + /// <Gender>Male</Gender> /// <FirstName>Frank</FirstName> - /// <Gender>Ma [rest of string was truncated]";. + /// <Alias m:type="Collection(Edm.String)"> + /// <d:element xmlns:d="htt [rest of string was truncated]";. /// </summary> internal static string TestCollectionOfPerson { get { @@ -399,13 +398,12 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<d:Person xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person"> + ///<d:property xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="System.Web.Http.OData.TestCommon.Models.Person"> /// <d:Age m:type="Edm.Int32">20</d:Age> - /// <d:FavoriteHobby m:type="HobbyActivity"> - /// <d:ActivityName>Xbox Gaming</d:ActivityName> - /// </d:FavoriteHobby> + /// <d:Gender>Male</d:Gender> /// <d:FirstName>Frank</d:FirstName> - /// <d:Gender>Male</d:Gend [rest of string was truncated]";. + /// <d:Alias m:type="Collection(Edm.String)"> + /// <d:element>Alias0</d:element [rest of string was truncated]";. /// </summary> internal static string TestComplexTypePerson { get { @@ -430,8 +428,9 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<entry xml:base="http://www.tempuri.org/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> - /// <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" type="application/ [rest of string was truncated]";. + ///<entry xml:base="http://localhost/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + /// <id>http://localhost/employees(0L)</id> + /// <category term="System.Web.Http.OData.TestCommon.Models.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/schem [rest of string was truncated]";. /// </summary> internal static string TestEntityTypeBasic { get { @@ -476,9 +475,13 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<feed xml:base="http://www.tempuri.org/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + ///<feed xml:base="http://localhost/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + /// <id>http://schemas.datacontract.org/2004/07/</id> + /// <title /> + /// <updated>UpdatedTime</updated> + /// <link rel="self" href="http://localhost/employees" /> /// <entry> - /// <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" type=" [rest of string was truncated]";. + /// <id>htt [rest of string was truncated]";. /// </summary> internal static string TestFeedOfEmployee { get { @@ -488,12 +491,12 @@ namespace System.Web.Http.OData { /// <summary> /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<ArrayOfstring xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> + ///<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> /// <element>Frank</element> /// <element>Steve</element> /// <element>Tom</element> /// <element>Chandler</element> - ///</ArrayOfstring>. + ///</property>. /// </summary> internal static string TestListOfStrings { get { diff --git a/test/System.Web.Http.OData.Test/BaselineResource.resx b/test/System.Web.Http.OData.Test/BaselineResource.resx index 320f74cb..07372441 100644 --- a/test/System.Web.Http.OData.Test/BaselineResource.resx +++ b/test/System.Web.Http.OData.Test/BaselineResource.resx @@ -527,122 +527,122 @@ </data> <data name="TestArrayOfBools" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<ArrayOfboolean xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> +<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">true</element> <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">false</element> <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">true</element> <element m:type="Edm.Boolean" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">false</element> -</ArrayOfboolean></value> +</property></value> </data> <data name="TestArrayOfInts" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<ArrayOfint xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> +<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">10</element> <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">20</element> <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">30</element> <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">40</element> <element m:type="Edm.Int32" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">50</element> -</ArrayOfint></value> +</property></value> </data> <data name="TestCollectionOfPerson" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<ArrayOfPerson xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> - <element m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> +<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + <element m:type="System.Web.Http.OData.TestCommon.Models.Person"> <Age m:type="Edm.Int32">20</Age> - <FavoriteHobby m:type="HobbyActivity"> - <ActivityName>Xbox Gaming</ActivityName> - </FavoriteHobby> - <FirstName>Frank</FirstName> <Gender>Male</Gender> - <HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <City>Redmond</City> - <State>WA</State> - <StreetAddress>4850 156th Ave NE</StreetAddress> - <ZipCode m:type="Edm.Int32">98052</ZipCode> - </HomeAddress> - <HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <AreaCode m:type="Edm.Int32">425</AreaCode> + <FirstName>Frank</FirstName> + <Alias m:type="Collection(Edm.String)"> + <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias0</d:element> + </Alias> + <Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <StreetAddress>StreetAddress1</StreetAddress> + <City>City1</City> + <State>State1</State> + <ZipCode m:type="Edm.Int32">1</ZipCode> + </Address> + <HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <CountryCode m:type="Edm.Int32">1</CountryCode> + <AreaCode m:type="Edm.Int32">425</AreaCode> <Number m:type="Edm.Int32">9879089</Number> <PhoneType>HomePhone</PhoneType> </HomeNumber> - <OtherNames > - <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias0</d:element> - </OtherNames> - </element> - <element m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> - <Age m:type="Edm.Int32">21</Age> - <FavoriteHobby m:type="HobbyActivity"> + <FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> <ActivityName>Xbox Gaming</ActivityName> </FavoriteHobby> - <FirstName>Steve</FirstName> + </element> + <element m:type="System.Web.Http.OData.TestCommon.Models.Person"> + <Age m:type="Edm.Int32">21</Age> <Gender>Male</Gender> - <HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <City>Redmond</City> - <State>WA</State> - <StreetAddress>4851 157th Ave NE</StreetAddress> - <ZipCode m:type="Edm.Int32">98053</ZipCode> - </HomeAddress> - <HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <AreaCode m:type="Edm.Int32">425</AreaCode> + <FirstName>Steve</FirstName> + <Alias m:type="Collection(Edm.String)"> + <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias1</d:element> + </Alias> + <Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <StreetAddress>StreetAddress2</StreetAddress> + <City>City2</City> + <State>State2</State> + <ZipCode m:type="Edm.Int32">2</ZipCode> + </Address> + <HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <CountryCode m:type="Edm.Int32">1</CountryCode> + <AreaCode m:type="Edm.Int32">425</AreaCode> <Number m:type="Edm.Int32">9879090</Number> <PhoneType>HomePhone</PhoneType> </HomeNumber> - <OtherNames > - <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias1</d:element> - </OtherNames> - </element> - <element m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> - <Age m:type="Edm.Int32">22</Age> - <FavoriteHobby m:type="HobbyActivity"> + <FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> <ActivityName>Xbox Gaming</ActivityName> </FavoriteHobby> - <FirstName>Tom</FirstName> + </element> + <element m:type="System.Web.Http.OData.TestCommon.Models.Person"> + <Age m:type="Edm.Int32">22</Age> <Gender>Male</Gender> - <HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <City>Redmond</City> - <State>WA</State> - <StreetAddress>4852 158th Ave NE</StreetAddress> - <ZipCode m:type="Edm.Int32">98054</ZipCode> - </HomeAddress> - <HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <AreaCode m:type="Edm.Int32">425</AreaCode> + <FirstName>Tom</FirstName> + <Alias m:type="Collection(Edm.String)"> + <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias2</d:element> + </Alias> + <Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <StreetAddress>StreetAddress3</StreetAddress> + <City>City3</City> + <State>State3</State> + <ZipCode m:type="Edm.Int32">3</ZipCode> + </Address> + <HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <CountryCode m:type="Edm.Int32">1</CountryCode> + <AreaCode m:type="Edm.Int32">425</AreaCode> <Number m:type="Edm.Int32">9879091</Number> <PhoneType>HomePhone</PhoneType> </HomeNumber> - <OtherNames > - <d:element xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">Alias2</d:element> - </OtherNames> + <FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> + <ActivityName>Xbox Gaming</ActivityName> + </FavoriteHobby> </element> -</ArrayOfPerson></value> +</property></value> </data> <data name="TestComplexTypePerson" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<d:Person xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Person"> +<d:property xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="System.Web.Http.OData.TestCommon.Models.Person"> <d:Age m:type="Edm.Int32">20</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Frank</d:FirstName> <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4850 156th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98052</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> + <d:FirstName>Frank</d:FirstName> + <d:Alias m:type="Collection(Edm.String)"> + <d:element>Alias0</d:element> + </d:Alias> + <d:Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <d:StreetAddress>StreetAddress1</d:StreetAddress> + <d:City>City1</d:City> + <d:State>State1</d:State> + <d:ZipCode m:type="Edm.Int32">1</d:ZipCode> + </d:Address> + <d:HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> + <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> <d:Number m:type="Edm.Int32">9879089</d:Number> <d:PhoneType>HomePhone</d:PhoneType> </d:HomeNumber> - <d:OtherNames > - <d:element>Alias0</d:element> - </d:OtherNames> -</d:Person></value> + <d:FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> + <d:ActivityName>Xbox Gaming</d:ActivityName> + </d:FavoriteHobby> +</d:property></value> </data> <data name="TestDictionary" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> @@ -667,44 +667,14 @@ </data> <data name="TestEntityTypeBasic" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<entry xml:base="http://www.tempuri.org/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" type="application/atom+xml;type=entry" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)/CurrentWorkItem"> - <m:inline> - <entry> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(25)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(25)" /> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - <content type="application/xml"> - <m:properties> - <d:EmployeeID m:type="Edm.Int32">0</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">16</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">25</d:WorkItemID> - </m:properties> - </content> - </entry> - </m:inline> - </link> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)/DirectReports"> - <m:inline> - <feed> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee</id> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - </feed> - </m:inline> - </link> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)" /> +<entry xml:base="http://localhost/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + <id>http://localhost/employees(0L)</id> + <category term="System.Web.Http.OData.TestCommon.Models.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" href="http://localhost/employees(0L)" /> + <link rel="self" href="http://localhost/employees(0L)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="http://localhost/employees(0L)/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="DirectReports" href="http://localhost/employees(0L)/DirectReports" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WorkItem" type="application/atom+xml;type=entry" title="WorkItem" href="http://localhost/employees(0L)/WorkItem" /> <title /> <updated>UpdatedTime</updated> <author> @@ -712,69 +682,28 @@ </author> <content type="application/xml"> <m:properties> + <d:EmployeeId m:type="Edm.Int64">0</d:EmployeeId> <d:Age m:type="Edm.Int32">20</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Frank</d:FirstName> <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4850 156th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98052</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> + <d:FirstName>Frank</d:FirstName> + <d:Alias m:type="Collection(Edm.String)"> + <d:element>Alias0</d:element> + </d:Alias> + <d:Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <d:StreetAddress>StreetAddress1</d:StreetAddress> + <d:City>City1</d:City> + <d:State>State1</d:State> + <d:ZipCode m:type="Edm.Int32">1</d:ZipCode> + </d:Address> + <d:HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> + <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> <d:Number m:type="Edm.Int32">9879089</d:Number> <d:PhoneType>HomePhone</d:PhoneType> </d:HomeNumber> - <d:OtherNames > - <d:element>Alias0</d:element> - </d:OtherNames> - <d:EmployeeId m:type="Edm.Int64">0</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">21</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Steve</d:FirstName> - <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4851 157th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98053</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> - <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> - <d:Number m:type="Edm.Int32">9879090</d:Number> - <d:PhoneType>HomePhone</d:PhoneType> - </d:HomeNumber> - <d:OtherNames > - <d:element>Alias1</d:element> - </d:OtherNames> - <d:CurrentWorkItem m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem"> - <d:EmployeeID m:type="Edm.Int32">1</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">17</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">26</d:WorkItemID> - </d:CurrentWorkItem> - - <d:EmployeeId m:type="Edm.Int64">1</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">22</d:Age> - <d:FirstName>Tom</d:FirstName> - <d:Gender>Male</d:Gender> - <d:OtherNames > - <d:element>Alias2</d:element> - </d:OtherNames> - - <d:EmployeeId m:type="Edm.Int64">2</d:EmployeeId> - </d:Manager> - </d:Manager> + <d:FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> + <d:ActivityName>Xbox Gaming</d:ActivityName> + </d:FavoriteHobby> </m:properties> </content> </entry></value> @@ -909,45 +838,19 @@ </data> <data name="TestFeedOfEmployee" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<feed xml:base="http://www.tempuri.org/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> +<feed xml:base="http://localhost/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> + <id>http://schemas.datacontract.org/2004/07/</id> + <title /> + <updated>UpdatedTime</updated> + <link rel="self" href="http://localhost/employees" /> <entry> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" type="application/atom+xml;type=entry" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)/CurrentWorkItem"> - <m:inline> - <entry> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(25)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(25)" /> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - <content type="application/xml"> - <m:properties> - <d:EmployeeID m:type="Edm.Int32">0</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">16</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">25</d:WorkItemID> - </m:properties> - </content> - </entry> - </m:inline> - </link> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)/DirectReports"> - <m:inline> - <feed> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee</id> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - </feed> - </m:inline> - </link> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(0)" /> + <id>http://localhost/employees(0L)</id> + <category term="System.Web.Http.OData.TestCommon.Models.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" href="http://localhost/employees(0L)" /> + <link rel="self" href="http://localhost/employees(0L)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="http://localhost/employees(0L)/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="DirectReports" href="http://localhost/employees(0L)/DirectReports" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WorkItem" type="application/atom+xml;type=entry" title="WorkItem" href="http://localhost/employees(0L)/WorkItem" /> <title /> <updated>UpdatedTime</updated> <author> @@ -955,110 +858,39 @@ </author> <content type="application/xml"> <m:properties> + <d:EmployeeId m:type="Edm.Int64">0</d:EmployeeId> <d:Age m:type="Edm.Int32">20</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Frank</d:FirstName> <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4850 156th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98052</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> + <d:FirstName>Frank</d:FirstName> + <d:Alias m:type="Collection(Edm.String)"> + <d:element>Alias0</d:element> + </d:Alias> + <d:Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <d:StreetAddress>StreetAddress1</d:StreetAddress> + <d:City>City1</d:City> + <d:State>State1</d:State> + <d:ZipCode m:type="Edm.Int32">1</d:ZipCode> + </d:Address> + <d:HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> + <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> <d:Number m:type="Edm.Int32">9879089</d:Number> <d:PhoneType>HomePhone</d:PhoneType> </d:HomeNumber> - <d:OtherNames > - <d:element>Alias0</d:element> - </d:OtherNames> - <d:EmployeeId m:type="Edm.Int64">0</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">21</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Steve</d:FirstName> - <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4851 157th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98053</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> - <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> - <d:Number m:type="Edm.Int32">9879090</d:Number> - <d:PhoneType>HomePhone</d:PhoneType> - </d:HomeNumber> - <d:OtherNames > - <d:element>Alias1</d:element> - </d:OtherNames> - <d:CurrentWorkItem m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem"> - <d:EmployeeID m:type="Edm.Int32">1</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">17</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">26</d:WorkItemID> - </d:CurrentWorkItem> - - <d:EmployeeId m:type="Edm.Int64">1</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">22</d:Age> - <d:FirstName>Tom</d:FirstName> - <d:Gender>Male</d:Gender> - <d:OtherNames > - <d:element>Alias2</d:element> - </d:OtherNames> - - <d:EmployeeId m:type="Edm.Int64">2</d:EmployeeId> - </d:Manager> - </d:Manager> + <d:FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> + <d:ActivityName>Xbox Gaming</d:ActivityName> + </d:FavoriteHobby> </m:properties> </content> </entry> <entry> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" type="application/atom+xml;type=entry" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentWorkItem" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(1)/CurrentWorkItem"> - <m:inline> - <entry> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(26)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem(26)" /> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - <content type="application/xml"> - <m:properties> - <d:EmployeeID m:type="Edm.Int32">1</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">17</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">26</d:WorkItemID> - </m:properties> - </content> - </entry> - </m:inline> - </link> - <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(1)/DirectReports"> - <m:inline> - <feed> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee</id> - <title /> - <updated>UpdatedTime</updated> - <author> - <name /> - </author> - </feed> - </m:inline> - </link> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(1)</id> - <category term="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> - <link rel="self" href="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee(1)" /> + <id>http://localhost/employees(1L)</id> + <category term="System.Web.Http.OData.TestCommon.Models.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" href="http://localhost/employees(1L)" /> + <link rel="self" href="http://localhost/employees(1L)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="http://localhost/employees(1L)/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DirectReports" type="application/atom+xml;type=feed" title="DirectReports" href="http://localhost/employees(1L)/DirectReports" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WorkItem" type="application/atom+xml;type=entry" title="WorkItem" href="http://localhost/employees(1L)/WorkItem" /> <title /> <updated>UpdatedTime</updated> <author> @@ -1066,85 +898,41 @@ </author> <content type="application/xml"> <m:properties> + <d:EmployeeId m:type="Edm.Int64">1</d:EmployeeId> <d:Age m:type="Edm.Int32">21</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Steve</d:FirstName> <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4851 157th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98053</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> + <d:FirstName>Steve</d:FirstName> + <d:Alias m:type="Collection(Edm.String)"> + <d:element>Alias1</d:element> + </d:Alias> + <d:Address m:type="System.Web.Http.OData.TestCommon.Models.Address"> + <d:StreetAddress>StreetAddress2</d:StreetAddress> + <d:City>City2</d:City> + <d:State>State2</d:State> + <d:ZipCode m:type="Edm.Int32">2</d:ZipCode> + </d:Address> + <d:HomeNumber m:type="System.Web.Http.OData.TestCommon.Models.PhoneNumber"> <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> + <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> <d:Number m:type="Edm.Int32">9879090</d:Number> <d:PhoneType>HomePhone</d:PhoneType> </d:HomeNumber> - <d:OtherNames > - <d:element>Alias1</d:element> - </d:OtherNames> - <d:EmployeeId m:type="Edm.Int64">1</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">22</d:Age> - <d:FavoriteHobby m:type="HobbyActivity"> - <d:ActivityName>Xbox Gaming</d:ActivityName> - </d:FavoriteHobby> - <d:FirstName>Tom</d:FirstName> - <d:Gender>Male</d:Gender> - <d:HomeAddress m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/Address"> - <d:City>Redmond</d:City> - <d:State>WA</d:State> - <d:StreetAddress>4852 158th Ave NE</d:StreetAddress> - <d:ZipCode m:type="Edm.Int32">98054</d:ZipCode> - </d:HomeAddress> - <d:HomeNumber m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.ComplexTypes/PhoneNumber"> - <d:AreaCode m:type="Edm.Int32">425</d:AreaCode> - <d:CountryCode m:type="Edm.Int32">1</d:CountryCode> - <d:Number m:type="Edm.Int32">9879091</d:Number> - <d:PhoneType>HomePhone</d:PhoneType> - </d:HomeNumber> - <d:OtherNames > - <d:element>Alias2</d:element> - </d:OtherNames> - <d:CurrentWorkItem m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/WorkItem"> - <d:EmployeeID m:type="Edm.Int32">2</d:EmployeeID> - <d:IsCompleted m:type="Edm.Boolean">false</d:IsCompleted> - <d:NumberOfHours m:type="Edm.Single">18</d:NumberOfHours> - <d:WorkItemID m:type="Edm.Int32">27</d:WorkItemID> - </d:CurrentWorkItem> - - <d:EmployeeId m:type="Edm.Int64">2</d:EmployeeId> - <d:Manager m:type="http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee"> - <d:Age m:type="Edm.Int32">23</d:Age> - <d:FirstName>Chandler</d:FirstName> - <d:Gender>Male</d:Gender> - <d:OtherNames > - <d:element>Alias3</d:element> - </d:OtherNames> - - <d:EmployeeId m:type="Edm.Int64">3</d:EmployeeId> - </d:Manager> - </d:Manager> + <d:FavoriteHobby m:type="System.Web.Http.OData.TestCommon.Models.IActivity"> + <d:ActivityName>Xbox Gaming</d:ActivityName> + </d:FavoriteHobby> </m:properties> </content> </entry> - <id>http://schemas.datacontract.org/2004/07/System.Net.Http.Formatting.OData.Test.EntityTypes/Employee</id> - <title /> - <updated>UpdatedTime</updated> </feed></value> </data> <data name="TestListOfStrings" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> -<ArrayOfstring xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> +<property xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> <element>Frank</element> <element>Steve</element> <element>Tom</element> <element>Chandler</element> -</ArrayOfstring></value> +</property></value> </data> <data name="TimeSpan" xml:space="preserve"> <value><?xml version="1.0" encoding="utf-8"?> diff --git a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/CollectionTest.cs b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/CollectionTest.cs index 791e19f5..c8589504 100644 --- a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/CollectionTest.cs +++ b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/CollectionTest.cs @@ -3,21 +3,22 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Net.Http; +using System.Web.Http.Hosting; +using System.Web.Http.OData.Builder; using System.Web.Http.OData.TestCommon.Models; -using Microsoft.Data.OData; +using Microsoft.Data.Edm; using Microsoft.TestCommon; namespace System.Web.Http.OData.Formatter.Serialization { public class CollectionTest { - ODataMediaTypeFormatter _formatter = new ODataMediaTypeFormatter(); + ODataMediaTypeFormatter _formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; /// <summary> /// Arrays the of ints serializes as O data. /// </summary> - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out array of ints in valid ODataMessageFormat")] + [Fact] public void ArrayOfIntsSerializesAsOData() { ObjectContent<int[]> content = new ObjectContent<int[]>(new int[] { 10, 20, 30, 40, 50 }, _formatter); @@ -25,8 +26,7 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestArrayOfInts, content.ReadAsStringAsync().Result); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out array of bool in valid ODataMessageFormat")] + [Fact] public void ArrayOfBoolsSerializesAsOData() { ObjectContent<bool[]> content = new ObjectContent<bool[]>(new bool[] { true, false, true, false }, _formatter); @@ -34,8 +34,7 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestArrayOfBools, content.ReadAsStringAsync().Result); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out List of strings in valid ODataMessageFormat")] + [Fact] public void ListOfStringsSerializesAsOData() { List<string> listOfStrings = new List<string>(); @@ -49,23 +48,7 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestListOfStrings, content.ReadAsStringAsync().Result); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter throws while writing out non-homogenous collection of objects")] - public void CollectionOfObjectsSerializesAsOData() - { - Collection<object> collectionOfObjects = new Collection<object>(); - collectionOfObjects.Add(1); - collectionOfObjects.Add("Frank"); - collectionOfObjects.Add(TypeInitializer.GetInstance(SupportedTypes.Person, 2)); - collectionOfObjects.Add(TypeInitializer.GetInstance(SupportedTypes.Employee, 3)); - - ObjectContent<Collection<object>> content = new ObjectContent<Collection<object>>(collectionOfObjects, _formatter); - - Assert.Throws<ODataException>(() => content.ReadAsStringAsync().Result); - } - - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out Collection of complex types in valid ODataMessageFormat")] + [Fact] public void CollectionOfComplexTypeSerializesAsOData() { IEnumerable<Person> collectionOfPerson = new Collection<Person>() @@ -80,22 +63,7 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestCollectionOfPerson, content.ReadAsStringAsync().Result); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out Dictionary type in valid ODataMessageFormat")] - public void DictionarySerializesAsOData() - { - Dictionary<int, string> dictionary = new Dictionary<int, string>(); - dictionary.Add(1, "Frank"); - dictionary.Add(2, "Steve"); - dictionary.Add(3, "Tom"); - dictionary.Add(4, "Chandler"); - - ObjectContent<Dictionary<int, string>> content = new ObjectContent<Dictionary<int, string>>(dictionary, _formatter); - - Assert.Xml.Equal(BaselineResource.TestDictionary, content.ReadAsStringAsync().Result); - } - - [Fact(Skip = "Requires new functionality in the odata formatter")] + [Fact] [Trait("Description", "ODataMediaTypeFormatter sets required headers for a complex type when serialized as XML.")] public void ContentHeadersAreAddedForXmlMediaType() { @@ -103,11 +71,10 @@ namespace System.Web.Http.OData.Formatter.Serialization content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Http.Contains(content.Headers, "Content-Type", "application/xml"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/xml; charset=utf-8"); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for a complex type when serialized as JSON.")] + [Fact] public void ContentHeadersAreAddedForJsonMediaType() { HttpContent content = new ObjectContent<Person[]>(new Person[] { new Person(0, new ReferenceDepthContext(7)) }, _formatter, "application/json"); @@ -116,5 +83,20 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); Assert.Equal(content.Headers.ContentType.MediaType, "application/json"); } + + private static HttpRequestMessage GetSampleRequest() + { + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/property"); + HttpConfiguration config = new HttpConfiguration(); + request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + return request; + } + + private static IEdmModel GetSampleModel() + { + ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); + builder.ComplexType<Person>(); + return builder.GetEdmModel(); + } } } diff --git a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/ComplexTypeTest.cs b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/ComplexTypeTest.cs index 2e25fdae..894ecb63 100644 --- a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/ComplexTypeTest.cs +++ b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/ComplexTypeTest.cs @@ -1,30 +1,19 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System.Net.Http; +using System.Web.Http.Hosting; using System.Web.Http.OData.Builder; using System.Web.Http.OData.TestCommon.Models; +using Microsoft.Data.Edm; using Microsoft.TestCommon; namespace System.Web.Http.OData.Formatter.Serialization { public class ComplexTypeTest { - ODataMediaTypeFormatter _formatter; + ODataMediaTypeFormatter _formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; - public ComplexTypeTest() - { - ODataModelBuilder model = new ODataModelBuilder(); - var person = model.ComplexType<Person>(); - person.Property(p => p.Age); - person.Property(p => p.FirstName); - person.ComplexProperty(p => p.FavoriteHobby); - person.ComplexProperty(p => p.Gender); - - _formatter = new ODataMediaTypeFormatter(model.GetEdmModel()); - } - - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter writes out complex types in valid ODataMessageFormat")] + [Fact] public void ComplexTypeSerializesAsOData() { ObjectContent<Person> content = new ObjectContent<Person>(new Person(0, new ReferenceDepthContext(7)), _formatter); @@ -32,19 +21,17 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestComplexTypePerson, content.ReadAsStringAsync().Result); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for a complex type when serialized as XML.")] + [Fact] public void ContentHeadersAreAddedForXmlMediaType() { ObjectContent<Person> content = new ObjectContent<Person>(new Person(0, new ReferenceDepthContext(7)), _formatter); content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Http.Contains(content.Headers, "Content-Type", "application/xml"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/xml; charset=utf-8"); } - [Fact(Skip = "Requires new functionality in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for a complex type when serialized as JSON.")] + [Fact] public void ContentHeadersAreAddedForJsonMediaType() { HttpContent content = new ObjectContent<Person>(new Person(0, new ReferenceDepthContext(7)), _formatter, "application/json"); @@ -53,5 +40,20 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); Assert.Equal(content.Headers.ContentType.MediaType, "application/json"); } + + private static HttpRequestMessage GetSampleRequest() + { + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/property"); + HttpConfiguration config = new HttpConfiguration(); + request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + return request; + } + + private static IEdmModel GetSampleModel() + { + ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); + builder.ComplexType<Person>(); + return builder.GetEdmModel(); + } } } diff --git a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/EntityTypeTest.cs b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/EntityTypeTest.cs index 1745f621..fbe7db04 100644 --- a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/EntityTypeTest.cs +++ b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/EntityTypeTest.cs @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System.Net.Http; +using System.Web.Http.Hosting; +using System.Web.Http.OData.Builder; using System.Web.Http.OData.TestCommon.Models; +using System.Web.Http.Routing; +using Microsoft.Data.Edm; using Microsoft.TestCommon; namespace System.Web.Http.OData.Formatter.Serialization { public class EntityTypeTest { - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter serailizes an entity type in valid ODataMessageFormat")] + [Fact] public void EntityTypeSerializesAsODataEntry() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); - + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; Employee employee = (Employee)TypeInitializer.GetInstance(SupportedTypes.Employee); ObjectContent<Employee> content = new ObjectContent<Employee>(employee, formatter); @@ -21,43 +23,45 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestEntityTypeBasic, content.ReadAsStringAsync().Result, regexReplacements: replaceUpdateTime); } - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter serailizes an entity type with multiple keys in valid ODataMessageFormat")] - public void EntityTypeWithMultipleKeysSerializesAsODataEntry() - { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); - - MultipleKeyEmployee multipleKeyEmployee = (MultipleKeyEmployee)TypeInitializer.GetInstance(SupportedTypes.MultipleKeyEmployee); - ObjectContent<MultipleKeyEmployee> content = new ObjectContent<MultipleKeyEmployee>(multipleKeyEmployee, formatter); - - RegexReplacement replaceUpdateTime = new RegexReplacement("<updated>*.*</updated>", "<updated>UpdatedTime</updated>"); - Assert.Xml.Equal(BaselineResource.TestEntityTypeWithMultipleKeys, content.ReadAsStringAsync().Result, regexReplacements: replaceUpdateTime); - } - - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for an entity type when serialized as XML.")] + [Fact] public void ContentHeadersAreAddedForXmlMediaType() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); - + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; ObjectContent<Employee> content = new ObjectContent<Employee>(new Employee(0, new ReferenceDepthContext(7)), formatter); content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Http.Contains(content.Headers, "Content-Type", "application/atom+xml; type=entry"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/atom+xml; type=entry; charset=utf-8"); } - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for an entity type when serialized as JSON.")] + [Fact] public void ContentHeadersAreAddedForJsonMediaType() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); - + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; HttpContent content = new ObjectContent<Employee>(new Employee(0, new ReferenceDepthContext(7)), formatter, "application/json"); content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Equal(content.Headers.ContentType.MediaType, "application/json"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/json; odata=verbose; charset=utf-8"); + } + + private static HttpRequestMessage GetSampleRequest() + { + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/employees"); + HttpConfiguration config = new HttpConfiguration(); + config.Routes.MapHttpRoute(ODataRouteNames.GetById, "{controller}({id})"); + config.Routes.MapHttpRoute(ODataRouteNames.PropertyNavigation, "{controller}({parentId})/{navigationProperty}"); + request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + request.Properties[HttpPropertyKeys.HttpRouteDataKey] = new HttpRouteData(new HttpRoute()); + return request; + } + + private static IEdmModel GetSampleModel() + { + ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); + builder.EntitySet<Employee>("employees"); + builder.EntitySet<WorkItem>("workitems"); + return builder.GetEdmModel(); } } } diff --git a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/FeedTest.cs b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/FeedTest.cs index 4b18a73d..f28aa304 100644 --- a/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/FeedTest.cs +++ b/test/System.Web.Http.OData.Test/OData/Formatter/Serialization/FeedTest.cs @@ -3,18 +3,21 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Net.Http; +using System.Web.Http.Hosting; +using System.Web.Http.OData.Builder; using System.Web.Http.OData.TestCommon.Models; +using System.Web.Http.Routing; +using Microsoft.Data.Edm; using Microsoft.TestCommon; namespace System.Web.Http.OData.Formatter.Serialization { public class FeedTest { - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter serailizes a feed in valid ODataMessageFormat")] + [Fact] public void IEnumerableOfEntityTypeSerializesAsODataFeed() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; IEnumerable<Employee> collectionOfPerson = new Collection<Employee>() { @@ -28,30 +31,48 @@ namespace System.Web.Http.OData.Formatter.Serialization Assert.Xml.Equal(BaselineResource.TestFeedOfEmployee, content.ReadAsStringAsync().Result, regexReplacements: replaceUpdateTime); } - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for a feed when serialized as ATOM.")] + [Fact] public void ContentHeadersAreAddedForXmlMediaType() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; ObjectContent<IEnumerable<Employee>> content = new ObjectContent<IEnumerable<Employee>>(new Employee[] { new Employee(0, new ReferenceDepthContext(7)) }, formatter); content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Http.Contains(content.Headers, "Content-Type", "application/atom+xml; type=feed"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/atom+xml; type=feed; charset=utf-8"); } - [Fact(Skip = "Requires inheritance support in the odata formatter")] - [Trait("Description", "ODataMediaTypeFormatter sets required headers for a feed when serialized as JSON.")] + [Fact] public void ContentHeadersAreAddedForJsonMediaType() { - ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(); + ODataMediaTypeFormatter formatter = new ODataMediaTypeFormatter(GetSampleModel()) { Request = GetSampleRequest() }; HttpContent content = new ObjectContent<IEnumerable<Employee>>(new Employee[] { new Employee(0, new ReferenceDepthContext(7)) }, formatter, "application/json"); content.LoadIntoBufferAsync().Wait(); Assert.Http.Contains(content.Headers, "DataServiceVersion", "3.0;"); - Assert.Equal(content.Headers.ContentType.MediaType, "application/json"); + Assert.Http.Contains(content.Headers, "Content-Type", "application/json; odata=verbose; charset=utf-8"); + } + + private static HttpRequestMessage GetSampleRequest() + { + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/employees"); + HttpConfiguration config = new HttpConfiguration(); + config.Routes.MapHttpRoute(ODataRouteNames.GetById, "{controller}({id})"); + config.Routes.MapHttpRoute(ODataRouteNames.Default, "{controller}"); + config.Routes.MapHttpRoute(ODataRouteNames.PropertyNavigation, "{controller}({parentId})/{navigationProperty}"); + request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + request.Properties[HttpPropertyKeys.HttpRouteDataKey] = new HttpRouteData(new HttpRoute()); + return request; + } + + private static IEdmModel GetSampleModel() + { + ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); + builder.EntitySet<Employee>("employees"); + builder.EntitySet<WorkItem>("workitems"); + return builder.GetEdmModel(); } } } diff --git a/test/System.Web.Http.OData.Test/System.Web.Http.OData.Test.csproj b/test/System.Web.Http.OData.Test/System.Web.Http.OData.Test.csproj index d3e6876d..6ba2ae7b 100644 --- a/test/System.Web.Http.OData.Test/System.Web.Http.OData.Test.csproj +++ b/test/System.Web.Http.OData.Test/System.Web.Http.OData.Test.csproj @@ -222,7 +222,6 @@ <Compile Include="TestCommon\Models\ComplexTypes\POCO\PhoneType.cs" /> <Compile Include="TestCommon\DataSource.cs" /> <Compile Include="TestCommon\Models\EntityTypes\Attributed\Employee.cs" /> - <Compile Include="TestCommon\Models\EntityTypes\Attributed\MultipleKeyEmployee.cs" /> <Compile Include="TestCommon\Models\EntityTypes\POCO\AddressEntity.cs" /> <Compile Include="TestCommon\Models\EntityTypes\POCO\WorkItem.cs" /> <Compile Include="TestCommon\ReferenceDepthContext.cs" /> diff --git a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/Attributed/Person.cs b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/Attributed/Person.cs index 543fadfc..5a7c78bf 100644 --- a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/Attributed/Person.cs +++ b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/Attributed/Person.cs @@ -16,13 +16,13 @@ namespace System.Web.Http.OData.TestCommon.Models [DataMember(IsRequired = true)] public string FirstName { get; set; } - [DataMember(Name = "OtherNames")] + [DataMember] public string[] Alias { get; set; } - [DataMember(Name = "HomeAddress")] + [DataMember] public Address Address { get; set; } - [DataMember(EmitDefaultValue = true)] + [DataMember] public PhoneNumber HomeNumber { get; set; } public string UnserializableSSN { get; set; } @@ -42,7 +42,7 @@ namespace System.Web.Http.OData.TestCommon.Models this.FavoriteHobby = new HobbyActivity("Xbox Gaming"); } - [DataContract(Namespace = "", Name = "HobbyActivity")] + [DataContract] public class HobbyActivity : IActivity { public HobbyActivity(string hobbyName) diff --git a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/Address.cs b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/Address.cs index 8764db68..648936f7 100644 --- a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/Address.cs +++ b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/Address.cs @@ -4,11 +4,11 @@ namespace System.Web.Http.OData.TestCommon.Models { public class Address { - public string StreetAddress; + public string StreetAddress { get; set; } - public string City; + public string City { get; set; } - public string State; + public string State { get; set; } public Address() { diff --git a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs index 0241a1fe..7c062842 100644 --- a/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs +++ b/test/System.Web.Http.OData.Test/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs @@ -4,12 +4,12 @@ namespace System.Web.Http.OData.TestCommon.Models { public struct PhoneNumber { - public int CountryCode; + public int CountryCode { get; set; } - public int AreaCode; + public int AreaCode { get; set; } - public int Number; + public int Number { get; set; } - public PhoneType PhoneType; + public PhoneType PhoneType { get; set; } } } diff --git a/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/Employee.cs b/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/Employee.cs index 13368360..6c167aed 100644 --- a/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/Employee.cs +++ b/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/Employee.cs @@ -11,16 +11,16 @@ namespace System.Web.Http.OData.TestCommon.Models { [Key] [DataMember] - public long EmployeeId; + public long EmployeeId { get; set; } [DataMember] - public Person Manager; + public Employee Manager { get; set; } [DataMember] - public List<Employee> DirectReports; + public List<Employee> DirectReports { get; set; } - [DataMember(Name = "CurrentWorkItem")] - public WorkItem WorkItem; + [DataMember] + public WorkItem WorkItem { get; set; } public Employee(int index, ReferenceDepthContext context) : base(index, context) diff --git a/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/MultipleKeyEmployee.cs b/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/MultipleKeyEmployee.cs deleted file mode 100644 index a7e60edb..00000000 --- a/test/System.Web.Http.OData.Test/TestCommon/Models/EntityTypes/Attributed/MultipleKeyEmployee.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. - -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; - -namespace System.Web.Http.OData.TestCommon.Models -{ - [DataContract] - public class MultipleKeyEmployee : Employee - { - [Key] - [DataMember] - public Guid EmployeeGuid; - - [Key] - [DataMember] - public string UniqueStringId - { - get; - set; - } - - public MultipleKeyEmployee(int index, ReferenceDepthContext context) - : base(index, context) - { - this.EmployeeGuid = new Guid("844080c0-2f9e-472e-8c72-1a8ecd9f9037"); - this.UniqueStringId = DataSource.Names[index] + index; - } - } -} diff --git a/test/System.Web.Http.OData.Test/TestCommon/TypeInitializer.cs b/test/System.Web.Http.OData.Test/TestCommon/TypeInitializer.cs index 3be4ae45..a5eb33d6 100644 --- a/test/System.Web.Http.OData.Test/TestCommon/TypeInitializer.cs +++ b/test/System.Web.Http.OData.Test/TestCommon/TypeInitializer.cs @@ -31,10 +31,6 @@ namespace System.Web.Http.OData { return new Employee(index, context); } - else if (type == SupportedTypes.MultipleKeyEmployee) - { - return new MultipleKeyEmployee(index, context); - } else if (type == SupportedTypes.Address) { return new Address(index, context); |