Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged Simple.OData and Simple.Data.OData projects.

  • Loading branch information...
commit 46600eeee59b504ff575487af45d2a4221585f52 1 parent b3dca3e
Vagif Abilov object authored
Showing with 6,384 additions and 6,492 deletions.
  1. +3 −3 CommonAssemblyInfo.cs
  2. +1 −1  NugetPack.cmd
  3. +1 −1  NugetPushOData.cmd
  4. +1 −1  {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/DeleteTest.cs
  5. +38 −38 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/EntityPluralizer.cs
  6. +88 −88 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/FindAllTest.cs
  7. +85 −85 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/FindAssociationTest.cs
  8. +71 −71 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/FindExpandTest.cs
  9. +80 −80 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/FindExtraClausesTest.cs
  10. +92 −92 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/FindOneTest.cs
  11. +2 −2 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/GetTest.cs
  12. +1 −1  {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/InsertTest.cs
  13. +1 −1  {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/Properties/AssemblyInfo.cs
  14. +26 −26 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/SchemaTest.cs
  15. +108 −112 ....IntegrationTest.csproj → Simple.Data.OData.IntegrationTests/Simple.Data.OData.IntegrationTests.csproj
  16. +2 −2 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/SpecialTest.cs
  17. +54 −54 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/TestBase.cs
  18. +57 −57 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/TestService.cs
  19. +1 −1  {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/UpdateTest.cs
  20. +9 −9 {Simple.Data.OData.IntegrationTest → Simple.Data.OData.IntegrationTests}/packages.config
  21. +29 −29 {Simple.OData.Test → Simple.Data.OData.UnitTests}/CommandBuilderTest.cs
  22. +129 −129 {Simple.OData.Test → Simple.Data.OData.UnitTests}/DataServicesHelperTests.cs
  23. +1 −1  {Simple.OData.Test → Simple.Data.OData.UnitTests}/ExpressionFormatterTest.cs
  24. 0  {Simple.OData.Test → Simple.Data.OData.UnitTests}/Properties/AssemblyInfo.cs
  25. +2,309 −2,309 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/MultipleCategoriesWithProducts.xml
  26. +547 −547 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/MultipleProducts.xml
  27. +987 −987 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/MultipleProductsWithCategory.xml
  28. +352 −352 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/SingleCategoryWithProducts.xml
  29. +27 −27 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/SingleProduct.xml
  30. +49 −49 {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/SingleProductWithCategory.xml
  31. 0  ...OData.Test → Simple.Data.OData.UnitTests}/Resources/SingleProductWithCollectionOfComplexProperties.xml
  32. 0  ...ata.Test → Simple.Data.OData.UnitTests}/Resources/SingleProductWithCollectionOfPrimitiveProperties.xml
  33. 0  {Simple.OData.Test → Simple.Data.OData.UnitTests}/Resources/SingleProductWithComplexProperty.xml
  34. +92 −92 ...e.OData.Test/Simple.OData.Test.csproj → Simple.Data.OData.UnitTests/Simple.Data.OData.UnitTests.csproj
  35. +4 −4 {Simple.OData.Test → Simple.Data.OData.UnitTests}/packages.config
  36. +284 −284 {Simple.OData → Simple.Data.OData}/CommandBuilder.cs
  37. +270 −272 {Simple.OData → Simple.Data.OData}/DataServicesHelper.cs
  38. +1 −1  {Simple.OData → Simple.Data.OData}/Edm/EdmHelper.cs
  39. +1 −1  {Simple.OData → Simple.Data.OData}/Edm/EdmSchema.cs
  40. +1 −1  {Simple.OData → Simple.Data.OData}/Edm/EdmType.cs
  41. +8 −8 {Simple.OData → Simple.Data.OData}/ExpressionFormatter.cs
  42. +2 −2 {Simple.OData → Simple.Data.OData}/FunctionNameConverter.cs
  43. +1 −2  Simple.Data.OData/ODataTableAdapter.cs
  44. +13 −13 Simple.Data.OData/Properties/AssemblyInfo.cs
  45. +3 −3 {Simple.OData → Simple.Data.OData}/Properties/Resources.Designer.cs
  46. +17 −17 {Simple.OData → Simple.Data.OData}/Properties/Resources.resx
  47. +1 −1  {Simple.OData → Simple.Data.OData}/RequestRunner.cs
  48. 0  {Simple.OData → Simple.Data.OData}/Resources/DataServicesAtomEntryXml.txt
  49. +1 −1  {Simple.OData → Simple.Data.OData}/RestVerbs.cs
  50. +33 −33 {Simple.OData → Simple.Data.OData}/Schema/Association.cs
  51. +44 −44 {Simple.OData → Simple.Data.OData}/Schema/AssociationCollection.cs
  52. +6 −6 {Simple.OData → Simple.Data.OData}/Schema/Column.cs
  53. +1 −1  {Simple.OData → Simple.Data.OData}/Schema/ColumnCollection.cs
  54. +66 −66 Simple.Data.OData/Schema/DatabaseSchema.cs
  55. +3 −3 {Simple.OData → Simple.Data.OData}/Schema/ISchemaProvider.cs
  56. +1 −1  {Simple.OData → Simple.Data.OData}/Schema/Key.cs
  57. +2 −2 Simple.Data.OData/Schema/ODataTable.cs
  58. +68 −71 Simple.Data.OData/Schema/SchemaProvider.cs
  59. +94 −94 {Simple.OData → Simple.Data.OData}/Schema/Table.cs
  60. +1 −1  {Simple.OData → Simple.Data.OData}/Schema/TableCollection.cs
  61. +34 −5 Simple.Data.OData/Simple.Data.OData.csproj
  62. +0 −1  Simple.Data.OData/Simple.Data.OData.nuspec
  63. +135 −135 {Simple.OData → Simple.Data.OData}/SimpleReferenceFormatter.cs
  64. +1 −1  {Simple.OData → Simple.Data.OData}/TableServiceException.cs
  65. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/DateTimeExtensionsTests.cs
  66. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Linq/EnumerableExtensionTests.cs
  67. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Properties/AssemblyInfo.cs
  68. +5 −4 {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Properties/Resources.Designer.cs
  69. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Properties/Resources.resx
  70. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Resources/TwitterStatusesSample.txt
  71. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Resources/XmlWithDefaultNamespace.txt
  72. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Resources/XmlWithNoNamespace.txt
  73. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Resources/XmlWithPrefixedNamespace.txt
  74. +2 −2 ...e.NExtLib.Tests/Simple.NExtLib.Tests.csproj → Simple.NExtLib.UnitTests/Simple.NExtLib.UnitTests.csproj
  75. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/StringExtensionTests.cs
  76. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Xml/Linq/XElementExtensionsTests.cs
  77. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Xml/XmlAttributesAsDictionaryReadTests.cs
  78. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Xml/XmlAttributesAsDictionaryWriteTests.cs
  79. +2 −2 {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Xml/XmlElementAsDictionaryReadTests.cs
  80. +1 −1  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/Xml/XmlElementAsDictionaryWriteTests.cs
  81. 0  {Simple.NExtLib.Tests → Simple.NExtLib.UnitTests}/packages.config
  82. +29 −37 Simple.OData.sln
  83. +0 −12 Simple.OData/Properties/AssemblyInfo.cs
  84. +0 −103 Simple.OData/Simple.OData.csproj
  85. +0 −4 Simple.OData/packages.config
6 CommonAssemblyInfo.cs
View
@@ -19,6 +19,6 @@
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.3.0.1")]
-[assembly: AssemblyFileVersion("0.3.0.1")]
-[assembly: AssemblyInformationalVersion("0.3.0.1")]
+[assembly: AssemblyVersion("0.3.1.0")]
+[assembly: AssemblyFileVersion("0.3.1.0")]
+[assembly: AssemblyInformationalVersion("0.3.1.0")]
2  NugetPack.cmd
View
@@ -1,3 +1,3 @@
cd .\%1
-call nuget pack -sym %1.csproj -Properties Configuration=Release
+call nuget pack -sym %1.csproj -Symbols -Properties Configuration=Release
cd ..\
2  NugetPushOData.cmd
View
@@ -1 +1 @@
-call .\NugetPush.cmd Simple.Data.OData\Simple.Data.OData %1 %2
+call .\NugetPush.cmd Simple.Data.OData %1 %2
2  Simple.Data.OData.IntegrationTest/DeleteTest.cs → Simple.Data.OData.IntegrationTests/DeleteTest.cs
View
@@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
76 ...le.Data.OData.IntegrationTest/EntityPluralizer.cs → ...e.Data.OData.IntegrationTests/EntityPluralizer.cs
View
@@ -1,38 +1,38 @@
-using System;
-using System.Collections.Generic;
-using System.Data.Entity.Design.PluralizationServices;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using Simple.Data.Extensions;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- class EntityPluralizer : IPluralizer
- {
- private readonly PluralizationService _pluralizationService =
- PluralizationService.CreateService(new CultureInfo("en-US"));
-
- public bool IsPlural(string word)
- {
- return _pluralizationService.IsPlural(word);
- }
-
- public bool IsSingular(string word)
- {
- return _pluralizationService.IsSingular(word);
- }
-
- public string Pluralize(string word)
- {
- bool upper = (word.IsAllUpperCase());
- word = _pluralizationService.Pluralize(word);
- return upper ? word.ToUpper(_pluralizationService.Culture) : word;
- }
-
- public string Singularize(string word)
- {
- return _pluralizationService.Singularize(word);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Design.PluralizationServices;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using Simple.Data.Extensions;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ class EntityPluralizer : IPluralizer
+ {
+ private readonly PluralizationService _pluralizationService =
+ PluralizationService.CreateService(new CultureInfo("en-US"));
+
+ public bool IsPlural(string word)
+ {
+ return _pluralizationService.IsPlural(word);
+ }
+
+ public bool IsSingular(string word)
+ {
+ return _pluralizationService.IsSingular(word);
+ }
+
+ public string Pluralize(string word)
+ {
+ bool upper = (word.IsAllUpperCase());
+ word = _pluralizationService.Pluralize(word);
+ return upper ? word.ToUpper(_pluralizationService.Culture) : word;
+ }
+
+ public string Singularize(string word)
+ {
+ return _pluralizationService.Singularize(word);
+ }
+ }
+}
176 Simple.Data.OData.IntegrationTest/FindAllTest.cs → Simple.Data.OData.IntegrationTests/FindAllTest.cs
View
@@ -1,88 +1,88 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using Xunit;
-
- public class FindAllTest : TestBase
- {
- [Fact]
- public void FindAllByName()
- {
- IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai");
-
- Assert.NotEmpty(products);
- }
-
- [Fact]
- public void FindAllByHomogenizedName()
- {
- IEnumerable<dynamic> products = _db.Products.FindAllByProduct_Name("Chai");
-
- Assert.NotEmpty(products);
- }
-
- [Fact]
- public void FindAllByNameWithSpecificLength()
- {
- IEnumerable<dynamic> products = _db.Products.FindAll(_db.Products.ProductName.Length() == 4);
-
- Assert.NotEmpty(products);
- }
-
- [Fact]
- public void FindAllByNameCount()
- {
- var count = _db.Products.FindAllByProductName("Chai").Count();
-
- Assert.Equal(1, count);
- }
-
- [Fact]
- public void FindAllByNameWithTotalCount()
- {
- Promise<int> count;
- IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai").WithTotalCount(out count).Take(1);
-
- Assert.NotEmpty(products);
- Assert.Equal(1, count);
- }
-
- [Fact]
- public void All()
- {
- IEnumerable<dynamic> products = _db.Products.All();
-
- Assert.NotEmpty(products);
- }
-
- [Fact]
- public void AllWithHomogenizedName()
- {
- IEnumerable<dynamic> orderDetails = _db.Order_Details.All();
-
- Assert.NotEmpty(orderDetails);
- }
-
- [Fact]
- public void AllCount()
- {
- var count = _db.Products.All().Count();
-
- Assert.True(count > 0);
- }
-
- [Fact]
- public void AllWithTotalCount()
- {
- Promise<int> count;
- IEnumerable<dynamic> products = _db.Products.All().WithTotalCount(out count).Take(1);
-
- Assert.NotEmpty(products);
- Assert.True(count > 1);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using Xunit;
+
+ public class FindAllTest : TestBase
+ {
+ [Fact]
+ public void FindAllByName()
+ {
+ IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai");
+
+ Assert.NotEmpty(products);
+ }
+
+ [Fact]
+ public void FindAllByHomogenizedName()
+ {
+ IEnumerable<dynamic> products = _db.Products.FindAllByProduct_Name("Chai");
+
+ Assert.NotEmpty(products);
+ }
+
+ [Fact]
+ public void FindAllByNameWithSpecificLength()
+ {
+ IEnumerable<dynamic> products = _db.Products.FindAll(_db.Products.ProductName.Length() == 4);
+
+ Assert.NotEmpty(products);
+ }
+
+ [Fact]
+ public void FindAllByNameCount()
+ {
+ var count = _db.Products.FindAllByProductName("Chai").Count();
+
+ Assert.Equal(1, count);
+ }
+
+ [Fact]
+ public void FindAllByNameWithTotalCount()
+ {
+ Promise<int> count;
+ IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai").WithTotalCount(out count).Take(1);
+
+ Assert.NotEmpty(products);
+ Assert.Equal(1, count);
+ }
+
+ [Fact]
+ public void All()
+ {
+ IEnumerable<dynamic> products = _db.Products.All();
+
+ Assert.NotEmpty(products);
+ }
+
+ [Fact]
+ public void AllWithHomogenizedName()
+ {
+ IEnumerable<dynamic> orderDetails = _db.Order_Details.All();
+
+ Assert.NotEmpty(orderDetails);
+ }
+
+ [Fact]
+ public void AllCount()
+ {
+ var count = _db.Products.All().Count();
+
+ Assert.True(count > 0);
+ }
+
+ [Fact]
+ public void AllWithTotalCount()
+ {
+ Promise<int> count;
+ IEnumerable<dynamic> products = _db.Products.All().WithTotalCount(out count).Take(1);
+
+ Assert.NotEmpty(products);
+ Assert.True(count > 1);
+ }
+ }
+}
170 ...Data.OData.IntegrationTest/FindAssociationTest.cs → ...ata.OData.IntegrationTests/FindAssociationTest.cs
View
@@ -1,85 +1,85 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using Xunit;
-
- public class FindAssociationTest : TestBase
- {
- [Fact]
- public void FindAllCategoryProducts()
- {
- // expected request: Products?$filter=Category/CategoryName+eq+%27Beverages%27
- IEnumerable<dynamic> products = _db.Products.FindAll(_db.Products.Category.CategoryName == "Beverages");
-
- Assert.NotEmpty(products);
- }
-
- [Fact]
- public void FindAllCustomerOrders()
- {
- // expected request: Customers('ALFKI')/Orders
- IEnumerable<dynamic> customerOrders = _db.Customers.FindAll(_db.Customers.CustomerID == "ALFKI").Orders;
- //IEnumerable<dynamic> customerOrders = _db.Customers.Orders.Get("ALFKI");
-
- Assert.NotEmpty(customerOrders);
- }
-
- [Fact]
- public void FindAllEmployeeSubordinates()
- {
- // expected request: Employees(1)/Subordinates
- IEnumerable<dynamic> subordinates = _db.Employees.Subordinates.Get(1);
-
- Assert.NotEmpty(subordinates);
- }
-
- [Fact]
- public void FindAllSuperiorEmployees()
- {
- // expected request: Employees?$filter=Superior/FirstName+eq+%27Nancy%27 and Superior/LastName+eq+%27Davolio%27
- IEnumerable<dynamic> employees = _db.Employees.FindAll(_db.Employees.Superior.FirstName == "Nancy" && _db.Employees.Superior.LastName == "Davolio");
-
- Assert.NotEmpty(employees);
- }
-
- [Fact]
- public void FindEmployeeSuperior()
- {
- // expected request: Employees(1)/Superior
- var superior = _db.Employees.Superior.Get(1);
-
- Assert.NotNull(superior);
- }
-
- [Fact]
- public void FindAllEmployeeOrders()
- {
- // expected request: Orders?$filter=Employee/FirstName+eq+%27Andrew%27 and Employee/LastName+eq+%27Fuller%27
- IEnumerable<dynamic> orders = _db.Orders.FindAll(_db.Orders.Employee.FirstName == "Andrew" && _db.Orders.Employee.LastName == "Fuller");
-
- Assert.NotEmpty(orders);
- }
-
- [Fact]
- public void FindProductCategory()
- {
- // expected request: Categories?filter=Products/ProductName+eq+%27Chai%27
- var category = _db.Category.Find(_db.Category.Products.ProductName == "Chai");
-
- Assert.Equal("Beverages", category.CategoryName);
- }
-
- [Fact]
- public void FindProductSupplier()
- {
- // expected request: Suppliers?filter=Products/ProductName+eq+%27Chai%27
- var supplier = _db.Supplier.Find(_db.Supplier.Products.ProductName == "Chai");
-
- Assert.Equal("Exotic Liquids", supplier.CompanyName);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using Xunit;
+
+ public class FindAssociationTest : TestBase
+ {
+ [Fact]
+ public void FindAllCategoryProducts()
+ {
+ // expected request: Products?$filter=Category/CategoryName+eq+%27Beverages%27
+ IEnumerable<dynamic> products = _db.Products.FindAll(_db.Products.Category.CategoryName == "Beverages");
+
+ Assert.NotEmpty(products);
+ }
+
+ [Fact]
+ public void FindAllCustomerOrders()
+ {
+ // expected request: Customers('ALFKI')/Orders
+ IEnumerable<dynamic> customerOrders = _db.Customers.FindAll(_db.Customers.CustomerID == "ALFKI").Orders;
+ //IEnumerable<dynamic> customerOrders = _db.Customers.Orders.Get("ALFKI");
+
+ Assert.NotEmpty(customerOrders);
+ }
+
+ [Fact]
+ public void FindAllEmployeeSubordinates()
+ {
+ // expected request: Employees(1)/Subordinates
+ IEnumerable<dynamic> subordinates = _db.Employees.Subordinates.Get(1);
+
+ Assert.NotEmpty(subordinates);
+ }
+
+ [Fact]
+ public void FindAllSuperiorEmployees()
+ {
+ // expected request: Employees?$filter=Superior/FirstName+eq+%27Nancy%27 and Superior/LastName+eq+%27Davolio%27
+ IEnumerable<dynamic> employees = _db.Employees.FindAll(_db.Employees.Superior.FirstName == "Nancy" && _db.Employees.Superior.LastName == "Davolio");
+
+ Assert.NotEmpty(employees);
+ }
+
+ [Fact]
+ public void FindEmployeeSuperior()
+ {
+ // expected request: Employees(1)/Superior
+ var superior = _db.Employees.Superior.Get(1);
+
+ Assert.NotNull(superior);
+ }
+
+ [Fact]
+ public void FindAllEmployeeOrders()
+ {
+ // expected request: Orders?$filter=Employee/FirstName+eq+%27Andrew%27 and Employee/LastName+eq+%27Fuller%27
+ IEnumerable<dynamic> orders = _db.Orders.FindAll(_db.Orders.Employee.FirstName == "Andrew" && _db.Orders.Employee.LastName == "Fuller");
+
+ Assert.NotEmpty(orders);
+ }
+
+ [Fact]
+ public void FindProductCategory()
+ {
+ // expected request: Categories?filter=Products/ProductName+eq+%27Chai%27
+ var category = _db.Category.Find(_db.Category.Products.ProductName == "Chai");
+
+ Assert.Equal("Beverages", category.CategoryName);
+ }
+
+ [Fact]
+ public void FindProductSupplier()
+ {
+ // expected request: Suppliers?filter=Products/ProductName+eq+%27Chai%27
+ var supplier = _db.Supplier.Find(_db.Supplier.Products.ProductName == "Chai");
+
+ Assert.Equal("Exotic Liquids", supplier.CompanyName);
+ }
+ }
+}
142 Simple.Data.OData.IntegrationTest/FindExpandTest.cs → Simple.Data.OData.IntegrationTests/FindExpandTest.cs
View
@@ -1,71 +1,71 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using Xunit;
-
- public class FindExpandTest : TestBase
- {
- [Fact]
- public void FindCategoryByNameExpandProducts()
- {
- // expected request: Categories?expand=Products&$filter=CategoryName+eq+'Beverages'
- var category = _db.Category.WithProducts().FindByCategoryName("Beverages");
-
- Assert.Equal("Beverages", category.CategoryName);
- Assert.True(category.Products.Count > 0);
- }
-
- [Fact]
- public void FindAllCategoriesWithProducts()
- {
- // expected request: Categories?expand=Products
- var categories = _db.Category.All().WithProducts().ToList();
-
- Assert.True(categories.Count > 0);
- Assert.True(categories[0].Products.Count > 0);
- }
-
- [Fact]
- public void FindAllProductsWithCategory()
- {
- // expected request: Products?expand=Category
- var products = _db.Products.All().WithCategory().ToList();
-
- Assert.True(products.Count > 0);
- Assert.Equal("Beverages", products[0].Category.CategoryName);
- }
-
- [Fact]
- public void GetCustomerExpandOrders()
- {
- // expected request: Customers('ALFKI')?$expand=Orders
- var customer = _db.Customer.WithOrders().Get("ALFKI");
-
- Assert.Equal("ALFKI", customer.CustomerID);
- Assert.True(customer.Orders.Count > 0);
- }
-
- [Fact]
- public void FindAllEmployeesExpandSubordinates()
- {
- // expected request: Employees?$expand=Subordinates
- var employees = _db.Employees.All().WithSubordinates().ToList();
-
- Assert.True(employees.Count > 0);
- Assert.True(employees[0].Subordinates.Count > 0);
- }
-
- [Fact]
- public void FindEmployeeWithSuperior()
- {
- // expected request: Employees?$expand=Superior&$filter=FirstName+eq+%27Nancy%27 and LastName+eq+%27Davolio%27
- var employee = _db.Employees.WithSuperior().FindByFirstNameAndLastName("Nancy", "Davolio");
- Assert.NotNull(employee);
- Assert.NotNull(employee.Superior);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using Xunit;
+
+ public class FindExpandTest : TestBase
+ {
+ [Fact]
+ public void FindCategoryByNameExpandProducts()
+ {
+ // expected request: Categories?expand=Products&$filter=CategoryName+eq+'Beverages'
+ var category = _db.Category.WithProducts().FindByCategoryName("Beverages");
+
+ Assert.Equal("Beverages", category.CategoryName);
+ Assert.True(category.Products.Count > 0);
+ }
+
+ [Fact]
+ public void FindAllCategoriesWithProducts()
+ {
+ // expected request: Categories?expand=Products
+ var categories = _db.Category.All().WithProducts().ToList();
+
+ Assert.True(categories.Count > 0);
+ Assert.True(categories[0].Products.Count > 0);
+ }
+
+ [Fact]
+ public void FindAllProductsWithCategory()
+ {
+ // expected request: Products?expand=Category
+ var products = _db.Products.All().WithCategory().ToList();
+
+ Assert.True(products.Count > 0);
+ Assert.Equal("Beverages", products[0].Category.CategoryName);
+ }
+
+ [Fact]
+ public void GetCustomerExpandOrders()
+ {
+ // expected request: Customers('ALFKI')?$expand=Orders
+ var customer = _db.Customer.WithOrders().Get("ALFKI");
+
+ Assert.Equal("ALFKI", customer.CustomerID);
+ Assert.True(customer.Orders.Count > 0);
+ }
+
+ [Fact]
+ public void FindAllEmployeesExpandSubordinates()
+ {
+ // expected request: Employees?$expand=Subordinates
+ var employees = _db.Employees.All().WithSubordinates().ToList();
+
+ Assert.True(employees.Count > 0);
+ Assert.True(employees[0].Subordinates.Count > 0);
+ }
+
+ [Fact]
+ public void FindEmployeeWithSuperior()
+ {
+ // expected request: Employees?$expand=Superior&$filter=FirstName+eq+%27Nancy%27 and LastName+eq+%27Davolio%27
+ var employee = _db.Employees.WithSuperior().FindByFirstNameAndLastName("Nancy", "Davolio");
+ Assert.NotNull(employee);
+ Assert.NotNull(employee.Superior);
+ }
+ }
+}
160 ...ata.OData.IntegrationTest/FindExtraClausesTest.cs → ...ta.OData.IntegrationTests/FindExtraClausesTest.cs
View
@@ -1,80 +1,80 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.CSharp.RuntimeBinder;
-using Simple.OData;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using Xunit;
-
- public class FindExtraClausesTest : TestBase
- {
- [Fact]
- public void AllSelect()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .Select(_db.Products.ProductID);
-
- Assert.True(products.First().ProductID > 0);
- Assert.Throws<RuntimeBinderException>(() => products.First().ProductName);
- }
-
- [Fact]
- public void AllTake()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .Take(1);
-
- Assert.Equal(1, products.Count());
- }
-
- [Fact]
- public void AllSkip()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .Skip(1);
-
- Assert.Equal(1, products.Count());
- }
-
- [Fact]
- public void AllSkipTake()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .Skip(2)
- .Take(1);
-
- Assert.Equal(0, products.Count());
- }
-
- [Fact]
- public void AllOrderByAscending()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .OrderBy(_db.Products.ProductName);
-
- Assert.Equal("Chai", products.First().ProductName);
- }
-
- [Fact]
- public void AllOrderByDescending()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .OrderByDescending(_db.Products.ProductName);
-
- Assert.Equal("Chang", products.First().ProductName);
- }
-
- [Fact]
- public void AllOrderByDescendingSelect()
- {
- IEnumerable<dynamic> products = _db.Products.All()
- .OrderByDescending(_db.Products.ProductName)
- .Select(_db.Products.ProductName);
-
- Assert.Equal("Chang", products.First().ProductName);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.CSharp.RuntimeBinder;
+using Simple.Data.OData;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using Xunit;
+
+ public class FindExtraClausesTest : TestBase
+ {
+ [Fact]
+ public void AllSelect()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .Select(_db.Products.ProductID);
+
+ Assert.True(products.First().ProductID > 0);
+ Assert.Throws<RuntimeBinderException>(() => products.First().ProductName);
+ }
+
+ [Fact]
+ public void AllTake()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .Take(1);
+
+ Assert.Equal(1, products.Count());
+ }
+
+ [Fact]
+ public void AllSkip()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .Skip(1);
+
+ Assert.Equal(1, products.Count());
+ }
+
+ [Fact]
+ public void AllSkipTake()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .Skip(2)
+ .Take(1);
+
+ Assert.Equal(0, products.Count());
+ }
+
+ [Fact]
+ public void AllOrderByAscending()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .OrderBy(_db.Products.ProductName);
+
+ Assert.Equal("Chai", products.First().ProductName);
+ }
+
+ [Fact]
+ public void AllOrderByDescending()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .OrderByDescending(_db.Products.ProductName);
+
+ Assert.Equal("Chang", products.First().ProductName);
+ }
+
+ [Fact]
+ public void AllOrderByDescendingSelect()
+ {
+ IEnumerable<dynamic> products = _db.Products.All()
+ .OrderByDescending(_db.Products.ProductName)
+ .Select(_db.Products.ProductName);
+
+ Assert.Equal("Chang", products.First().ProductName);
+ }
+ }
+}
184 Simple.Data.OData.IntegrationTest/FindOneTest.cs → Simple.Data.OData.IntegrationTests/FindOneTest.cs
View
@@ -1,92 +1,92 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Simple.OData;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using Xunit;
-
- public class FindOneTest : TestBase
- {
- [Fact]
- public void FindOne()
- {
- var product = _db.Products.FindByProductName("Chai");
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameEqual()
- {
- var product = _db.Products.Find(_db.Products.ProductName == "Chai");
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameEqualToLower()
- {
- var product = _db.Products.Find(_db.Products.ProductName.ToLower() == "chai");
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameWithSpecificLength()
- {
- var product = _db.Products.Find(_db.Products.ProductName.Length() == 4);
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameStartsWith()
- {
- var product = _db.Products.Find(_db.Products.ProductName.StartsWith("Ch") == true);
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameContainsEqualsTrue()
- {
- var product = _db.Products.Find(_db.Products.ProductName.Contains("ai") == true);
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameContainsEqualsFalse()
- {
- var product = _db.Products.Find(_db.Products.ProductName.Contains("ai") == false);
-
- Assert.Equal("Chang", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameIndexOf()
- {
- var product = _db.Products.Find(_db.Products.ProductName.IndexOf("ai") == 2);
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameEqualSubstring()
- {
- var product = _db.Products.Find(_db.Products.ProductName.Substring(1) == "hai");
-
- Assert.Equal("Chai", product.ProductName);
- }
-
- [Fact]
- public void FindWhereNameEqualWithInvalidFunction()
- {
- Assert.Throws<TableServiceException>(
- () => _db.Products.Find(_db.Products.ProductName.InvalidFunction() == "Chai"));
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Simple.Data.OData;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using Xunit;
+
+ public class FindOneTest : TestBase
+ {
+ [Fact]
+ public void FindOne()
+ {
+ var product = _db.Products.FindByProductName("Chai");
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameEqual()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName == "Chai");
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameEqualToLower()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.ToLower() == "chai");
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameWithSpecificLength()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.Length() == 4);
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameStartsWith()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.StartsWith("Ch") == true);
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameContainsEqualsTrue()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.Contains("ai") == true);
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameContainsEqualsFalse()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.Contains("ai") == false);
+
+ Assert.Equal("Chang", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameIndexOf()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.IndexOf("ai") == 2);
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameEqualSubstring()
+ {
+ var product = _db.Products.Find(_db.Products.ProductName.Substring(1) == "hai");
+
+ Assert.Equal("Chai", product.ProductName);
+ }
+
+ [Fact]
+ public void FindWhereNameEqualWithInvalidFunction()
+ {
+ Assert.Throws<TableServiceException>(
+ () => _db.Products.Find(_db.Products.ProductName.InvalidFunction() == "Chai"));
+ }
+ }
+}
4 Simple.Data.OData.IntegrationTest/GetTest.cs → Simple.Data.OData.IntegrationTests/GetTest.cs
View
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Simple.OData;
+using Simple.Data.OData;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
2  Simple.Data.OData.IntegrationTest/InsertTest.cs → Simple.Data.OData.IntegrationTests/InsertTest.cs
View
@@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
2  ....OData.IntegrationTest/Properties/AssemblyInfo.cs → ...OData.IntegrationTests/Properties/AssemblyInfo.cs
View
@@ -5,7 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("Simple.Data.OData.IntegrationTest")]
+[assembly: AssemblyTitle("Simple.Data.OData.IntegrationTests")]
[assembly: AssemblyDescription("")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
52 Simple.Data.OData.IntegrationTest/SchemaTest.cs → Simple.Data.OData.IntegrationTests/SchemaTest.cs
View
@@ -4,7 +4,7 @@
using System.Text;
using Simple.Data.OData.Schema;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
@@ -37,14 +37,14 @@ public void FindTable()
var table = Schema.FindTable("Customers");
Assert.NotNull(table);
- }
-
- [Fact]
- public void GetColumnsCount()
- {
- var columns = Schema.FindTable("Employees").Columns;
-
- Assert.Equal(18, columns.Count());
+ }
+
+ [Fact]
+ public void GetColumnsCount()
+ {
+ var columns = Schema.FindTable("Employees").Columns;
+
+ Assert.Equal(18, columns.Count());
}
[Fact]
@@ -53,23 +53,23 @@ public void FindColumn()
var column = Schema.FindTable("Employees").FindColumn("first_name");
Assert.Equal("FirstName", column.ActualName);
- }
-
- [Fact]
- public void GetAssociationsCount()
- {
- var associations = Schema.FindTable("Employees").Associations;
-
- Assert.Equal(4, associations.Count());
- }
-
- [Fact]
- public void FindAssociation()
- {
- var association = Schema.FindTable("Employees").FindAssociation("superior");
-
- Assert.Equal("Employees", association.ReferenceTableName);
- }
+ }
+
+ [Fact]
+ public void GetAssociationsCount()
+ {
+ var associations = Schema.FindTable("Employees").Associations;
+
+ Assert.Equal(4, associations.Count());
+ }
+
+ [Fact]
+ public void FindAssociation()
+ {
+ var association = Schema.FindTable("Employees").FindAssociation("superior");
+
+ Assert.Equal("Employees", association.ReferenceTableName);
+ }
[Fact]
public void GetCompoundPrimaryKey()
220 ...tionTest/Simple.Data.OData.IntegrationTest.csproj → ...onTests/Simple.Data.OData.IntegrationTests.csproj
View
@@ -1,119 +1,115 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{96E43534-0CDC-4ECA-972E-4536055F8C63}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Simple.Data.OData.IntegrationTest</RootNamespace>
- <AssemblyName>Simple.Data.OData.IntegrationTest</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Data.Edm">
- <HintPath>..\packages\Microsoft.Data.Edm.5.0.1\lib\net40\Microsoft.Data.Edm.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Data.OData">
- <HintPath>..\packages\Microsoft.Data.OData.5.0.1\lib\net40\Microsoft.Data.OData.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Data.Services">
- <HintPath>..\packages\Microsoft.Data.Services.5.0.1\lib\net40\Microsoft.Data.Services.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Data.Services.Client">
- <HintPath>..\packages\Microsoft.Data.Services.Client.5.0.1\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
- </Reference>
- <Reference Include="Simple.Data, Version=0.17.0.1, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Simple.Data.Core.0.17.0.1\lib\net40\Simple.Data.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.Entity" />
- <Reference Include="System.Data.Entity.Design" />
- <Reference Include="System.ServiceModel" />
- <Reference Include="System.ServiceModel.Web" />
- <Reference Include="System.Spatial">
- <HintPath>..\packages\System.Spatial.5.0.1\lib\net40\System.Spatial.dll</HintPath>
- </Reference>
- <Reference Include="System.Xml.Linq" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- <Reference Include="xunit, Version=1.9.1.1600, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\xunit.1.9.1\lib\net20\xunit.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\CommonAssemblyInfo.cs">
- <Link>Properties\CommonAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="DeleteTest.cs" />
- <Compile Include="EntityPluralizer.cs" />
- <Compile Include="FindAllTest.cs" />
- <Compile Include="FindExpandTest.cs" />
- <Compile Include="FindOneTest.cs" />
- <Compile Include="FindExtraClausesTest.cs" />
- <Compile Include="GetTest.cs" />
- <Compile Include="InsertTest.cs" />
- <Compile Include="FindAssociationTest.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="SchemaTest.cs" />
- <Compile Include="SpecialTest.cs" />
- <Compile Include="TestBase.cs" />
- <Compile Include="TestService.cs" />
- <Compile Include="UpdateTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config">
- <SubType>Designer</SubType>
- </None>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Simple.Data.OData.NorthwindModel\Simple.Data.OData.NorthwindModel.csproj">
- <Project>{2A909E4D-6493-4D36-9FDE-786B89F9A387}</Project>
- <Name>Simple.Data.OData.NorthwindModel</Name>
- </ProjectReference>
- <ProjectReference Include="..\Simple.Data.OData\Simple.Data.OData.csproj">
- <Project>{E6EC2C3A-A7D8-41C3-ADCB-37B44F12B6F8}</Project>
- <Name>Simple.Data.OData</Name>
- </ProjectReference>
- <ProjectReference Include="..\Simple.OData\Simple.OData.csproj">
- <Project>{00590565-A937-44EE-AA81-2B407F104380}</Project>
- <Name>Simple.OData</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{96E43534-0CDC-4ECA-972E-4536055F8C63}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Simple.Data.OData.IntegrationTests</RootNamespace>
+ <AssemblyName>Simple.Data.OData.IntegrationTests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Data.Edm">
+ <HintPath>..\packages\Microsoft.Data.Edm.5.0.1\lib\net40\Microsoft.Data.Edm.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Data.OData">
+ <HintPath>..\packages\Microsoft.Data.OData.5.0.1\lib\net40\Microsoft.Data.OData.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Data.Services">
+ <HintPath>..\packages\Microsoft.Data.Services.5.0.1\lib\net40\Microsoft.Data.Services.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Data.Services.Client">
+ <HintPath>..\packages\Microsoft.Data.Services.Client.5.0.1\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
+ </Reference>
+ <Reference Include="Simple.Data, Version=0.17.0.1, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Simple.Data.Core.0.17.0.1\lib\net40\Simple.Data.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.Entity" />
+ <Reference Include="System.Data.Entity.Design" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.ServiceModel.Web" />
+ <Reference Include="System.Spatial">
+ <HintPath>..\packages\System.Spatial.5.0.1\lib\net40\System.Spatial.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="xunit, Version=1.9.1.1600, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\xunit.1.9.1\lib\net20\xunit.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\CommonAssemblyInfo.cs">
+ <Link>Properties\CommonAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="DeleteTest.cs" />
+ <Compile Include="EntityPluralizer.cs" />
+ <Compile Include="FindAllTest.cs" />
+ <Compile Include="FindExpandTest.cs" />
+ <Compile Include="FindOneTest.cs" />
+ <Compile Include="FindExtraClausesTest.cs" />
+ <Compile Include="GetTest.cs" />
+ <Compile Include="InsertTest.cs" />
+ <Compile Include="FindAssociationTest.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SchemaTest.cs" />
+ <Compile Include="SpecialTest.cs" />
+ <Compile Include="TestBase.cs" />
+ <Compile Include="TestService.cs" />
+ <Compile Include="UpdateTest.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Simple.Data.OData.NorthwindModel\Simple.Data.OData.NorthwindModel.csproj">
+ <Project>{2A909E4D-6493-4D36-9FDE-786B89F9A387}</Project>
+ <Name>Simple.Data.OData.NorthwindModel</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Simple.Data.OData\Simple.Data.OData.csproj">
+ <Project>{E6EC2C3A-A7D8-41C3-ADCB-37B44F12B6F8}</Project>
+ <Name>Simple.Data.OData</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project>
4 Simple.Data.OData.IntegrationTest/SpecialTest.cs → Simple.Data.OData.IntegrationTests/SpecialTest.cs
View
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Simple.OData;
+using Simple.Data.OData;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
108 Simple.Data.OData.IntegrationTest/TestBase.cs → Simple.Data.OData.IntegrationTests/TestBase.cs
View
@@ -1,54 +1,54 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Simple.Data.OData.NorthwindModel;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- public class TestBase : IDisposable
- {
- protected TestService _service;
- protected dynamic _db;
-
- public TestBase()
- {
- _service = new TestService(typeof(NorthwindService));
- _db = Database.Opener.Open(_service.ServiceUri);
- Database.SetPluralizer(new EntityPluralizer());
-
- CreateTestData();
- }
-
- public void Dispose()
- {
- if (_service != null)
- {
- _service.Dispose();
- _service = null;
- }
- }
-
- protected void CreateTestData()
- {
- _db.Customers.DeleteAll();
- _db.Employees.DeleteAll();
- _db.Categories.DeleteAll();
- _db.Suppliers.DeleteAll();
- _db.Products.DeleteAll();
- _db.Orders.DeleteAll();
- _db.OrderDetails.DeleteAll();
-
- _db.Customers.Insert(CustomerID: "ALFKI", CompanyName: "Alfreds Futterkiste");
- _db.Employees.Insert(EmployeeID: 1, FirstName: "Andrew", LastName: "Fuller");
- _db.Employees.Insert(EmployeeID: 2, FirstName: "Nancy", LastName: "Davolio", ReportsTo: 1);
- _db.Employees.Insert(EmployeeID: 3, FirstName: "Janet", LastName: "Leverling", ReportsTo: 1);
- _db.Categories.Insert(CategoryID: 1, CategoryName: "Beverages");
- _db.Suppliers.Insert(SupplierID: 1, CompanyName: "Exotic Liquids");
- _db.Products.Insert(ProductID: 1, ProductName: "Chai", UnitPrice: 18m, CategoryID: 1);
- _db.Products.Insert(ProductID: 2, ProductName: "Chang", UnitPrice: 19m, CategoryID: 1);
- _db.Orders.Insert(OrderID: 10255, CustomerID: "ALFKI", EmployeeID: 1);
- _db.OrderDetails.Insert(OrderID: 10255, ProductID: 2, UnitPrice: 15m, Quantity: 20);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Simple.Data.OData.NorthwindModel;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ public class TestBase : IDisposable
+ {
+ protected TestService _service;
+ protected dynamic _db;
+
+ public TestBase()
+ {
+ _service = new TestService(typeof(NorthwindService));
+ _db = Database.Opener.Open(_service.ServiceUri);
+ Database.SetPluralizer(new EntityPluralizer());
+
+ CreateTestData();
+ }
+
+ public void Dispose()
+ {
+ if (_service != null)
+ {
+ _service.Dispose();
+ _service = null;
+ }
+ }
+
+ protected void CreateTestData()
+ {
+ _db.Customers.DeleteAll();
+ _db.Employees.DeleteAll();
+ _db.Categories.DeleteAll();
+ _db.Suppliers.DeleteAll();
+ _db.Products.DeleteAll();
+ _db.Orders.DeleteAll();
+ _db.OrderDetails.DeleteAll();
+
+ _db.Customers.Insert(CustomerID: "ALFKI", CompanyName: "Alfreds Futterkiste");
+ _db.Employees.Insert(EmployeeID: 1, FirstName: "Andrew", LastName: "Fuller");
+ _db.Employees.Insert(EmployeeID: 2, FirstName: "Nancy", LastName: "Davolio", ReportsTo: 1);
+ _db.Employees.Insert(EmployeeID: 3, FirstName: "Janet", LastName: "Leverling", ReportsTo: 1);
+ _db.Categories.Insert(CategoryID: 1, CategoryName: "Beverages");
+ _db.Suppliers.Insert(SupplierID: 1, CompanyName: "Exotic Liquids");
+ _db.Products.Insert(ProductID: 1, ProductName: "Chai", UnitPrice: 18m, CategoryID: 1);
+ _db.Products.Insert(ProductID: 2, ProductName: "Chang", UnitPrice: 19m, CategoryID: 1);
+ _db.Orders.Insert(OrderID: 10255, CustomerID: "ALFKI", EmployeeID: 1);
+ _db.OrderDetails.Insert(OrderID: 10255, ProductID: 2, UnitPrice: 15m, Quantity: 20);
+ }
+ }
+}
114 Simple.Data.OData.IntegrationTest/TestService.cs → Simple.Data.OData.IntegrationTests/TestService.cs
View
@@ -1,57 +1,57 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Simple.Data.OData.IntegrationTest
-{
- using System;
- using System.ServiceModel.Web;
- using System.Threading;
-
- public class TestService : IDisposable
- {
- private WebServiceHost _host;
- private Uri _serviceUri;
- private static int _lastHostId = 1;
-
- public TestService(Type serviceType)
- {
- for (int i = 0; i < 100; i++)
- {
- int hostId = Interlocked.Increment(ref _lastHostId);
- this._serviceUri = new Uri("http://" + Environment.MachineName + "/Temporary_Listen_Addresses/SimpleODataTestService" + hostId.ToString() + "/");
- this._host = new WebServiceHost(serviceType, this._serviceUri);
- try
- {
- this._host.Open();
- break;
- }
- catch (Exception)
- {
- this._host.Abort();
- this._host = null;
- }
- }
-
- if (this._host == null)
- {
- throw new InvalidOperationException("Could not open a service even after 100 tries.");
- }
- }
-
- public void Dispose()
- {
- if (this._host != null)
- {
- this._host.Close();
- this._host = null;
- }
- }
-
- public Uri ServiceUri
- {
- get { return this._serviceUri; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Simple.Data.OData.IntegrationTests
+{
+ using System;
+ using System.ServiceModel.Web;
+ using System.Threading;
+
+ public class TestService : IDisposable
+ {
+ private WebServiceHost _host;
+ private Uri _serviceUri;
+ private static int _lastHostId = 1;
+
+ public TestService(Type serviceType)
+ {
+ for (int i = 0; i < 100; i++)
+ {
+ int hostId = Interlocked.Increment(ref _lastHostId);
+ this._serviceUri = new Uri("http://" + Environment.MachineName + "/Temporary_Listen_Addresses/SimpleODataTestService" + hostId.ToString() + "/");
+ this._host = new WebServiceHost(serviceType, this._serviceUri);
+ try
+ {
+ this._host.Open();
+ break;
+ }
+ catch (Exception)
+ {
+ this._host.Abort();
+ this._host = null;
+ }
+ }
+
+ if (this._host == null)
+ {
+ throw new InvalidOperationException("Could not open a service even after 100 tries.");
+ }
+ }
+
+ public void Dispose()
+ {
+ if (this._host != null)
+ {
+ this._host.Close();
+ this._host = null;
+ }
+ }
+
+ public Uri ServiceUri
+ {
+ get { return this._serviceUri; }
+ }
+ }
+}
2  Simple.Data.OData.IntegrationTest/UpdateTest.cs → Simple.Data.OData.IntegrationTests/UpdateTest.cs
View
@@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
-namespace Simple.Data.OData.IntegrationTest
+namespace Simple.Data.OData.IntegrationTests
{
using Xunit;
18 Simple.Data.OData.IntegrationTest/packages.config → Simple.Data.OData.IntegrationTests/packages.config
View
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Microsoft.Data.Edm" version="5.0.1" />
- <package id="Microsoft.Data.OData" version="5.0.1" />
- <package id="Microsoft.Data.Services" version="5.0.1" />
- <package id="Microsoft.Data.Services.Client" version="5.0.1" />
- <package id="Simple.Data.Core" version="0.17.0.1" />
- <package id="System.Spatial" version="5.0.1" />
- <package id="xunit" version="1.9.1" />
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.Data.Edm" version="5.0.1" />
+ <package id="Microsoft.Data.OData" version="5.0.1" />
+ <package id="Microsoft.Data.Services" version="5.0.1" />
+ <package id="Microsoft.Data.Services.Client" version="5.0.1" />
+ <package id="Simple.Data.Core" version="0.17.0.1" />
+ <package id="System.Spatial" version="5.0.1" />
+ <package id="xunit" version="1.9.1" />
</packages>
58 Simple.OData.Test/CommandBuilderTest.cs → Simple.Data.OData.UnitTests/CommandBuilderTest.cs
View
@@ -1,29 +1,29 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Simple.Data;
-using Simple.OData.Schema;
-using Xunit;
-
-namespace Simple.OData.Test
-{
- public class CommandBuilderTest
- {
- private CommandBuilder _commandBuilder = new CommandBuilder(x => new Table(x));
-
- [Fact]
- public void BuildsCommandFromTableNameWithNoFilter()
- {
- string command = _commandBuilder.BuildCommand("Products", null);
- Assert.Equal("Products", command);
- }
-
- [Fact]
- public void BuildsCommandFromTableNameWithFilter()
- {
- string command = _commandBuilder.BuildCommand("Products", "a eq 1");
- Assert.Equal("Products?$filter=a+eq+1", command);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Simple.Data;
+using Simple.Data.OData.Schema;
+using Xunit;
+
+namespace Simple.Data.OData.UnitTests
+{
+ public class CommandBuilderTest
+ {
+ private CommandBuilder _commandBuilder = new CommandBuilder(x => new Table(x));
+
+ [Fact]
+ public void BuildsCommandFromTableNameWithNoFilter()
+ {
+ string command = _commandBuilder.BuildCommand("Products", null);
+ Assert.Equal("Products", command);
+ }
+
+ [Fact]
+ public void BuildsCommandFromTableNameWithFilter()
+ {
+ string command = _commandBuilder.BuildCommand("Products", "a eq 1");
+ Assert.Equal("Products?$filter=a+eq+1", command);
+ }
+ }
+}
258 Simple.OData.Test/DataServicesHelperTests.cs → ...e.Data.OData.UnitTests/DataServicesHelperTests.cs
View
@@ -1,129 +1,129 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using Xunit;
-
-namespace Simple.OData.Test
-{
- public class DataServicesHelperTests
- {
- private const int productProperties = 10;
- private const int categoryProperties = 4;
-
- [Fact]
- public void GetDataParsesSingleProduct()
- {
- string document = GetResourceAsString("SingleProduct.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(productProperties, result.First().Count);
- }
-
- [Fact]
- public void GetDataParsesMultipleProducts()
- {
- string document = GetResourceAsString("MultipleProducts.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(20, result.Count());
- Assert.Equal(productProperties, result.First().Count);
- }
-
- [Fact]
- public void GetDataParsesSingleProductWithCategory()
- {
- string document = GetResourceAsString("SingleProductWithCategory.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(productProperties + 1, result.First().Count);
- Assert.Equal(categoryProperties, (result.First()["Category"] as IDictionary<string,object>).Count);
- }
-
- [Fact]
- public void GetDataParsesMultipleProductsWithCategory()
- {
- string document = GetResourceAsString("MultipleProductsWithCategory.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(20, result.Count());
- Assert.Equal(productProperties + 1, result.First().Count);
- Assert.Equal(categoryProperties, (result.First()["Category"] as IDictionary<string, object>).Count);
- }
-
- [Fact]
- public void GetDataParsesSingleCategoryWithProducts()
- {
- string document = GetResourceAsString("SingleCategoryWithProducts.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(categoryProperties + 1, result.First().Count);
- Assert.Equal(12, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).Count());
- Assert.Equal(productProperties, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).First().Count);
- }
-
- [Fact]
- public void GetDataParsesMultipleCategoriesWithProducts()
- {
- string document = GetResourceAsString("MultipleCategoriesWithProducts.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(8, result.Count());
- Assert.Equal(categoryProperties + 1, result.First().Count);
- Assert.Equal(12, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).Count());
- Assert.Equal(productProperties, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).First().Count);
- }
-
- [Fact]
- public void GetDataParsesSingleProductWithComplexProperty()
- {
- string document = GetResourceAsString("SingleProductWithComplexProperty.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(productProperties + 1, result.First().Count);
- var quantity = result.First()["Quantity"] as IDictionary<string, object>;
- Assert.NotNull(quantity);
- Assert.Equal(10d, quantity["Value"]);
- Assert.Equal("bags", quantity["Units"]);
- }
-
- [Fact]
- public void GetDataParsesSingleProductWithCollectionOfPrimitiveProperties()
- {
- string document = GetResourceAsString("SingleProductWithCollectionOfPrimitiveProperties.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(productProperties + 1, result.First().Count);
- var tags = result.First()["Tags"] as IList<dynamic>;
- Assert.Equal(2, tags.Count);
- Assert.Equal("Bakery", tags[0]);
- Assert.Equal("Food", tags[1]);
- }
-
- [Fact]
- public void GetDataParsesSingleProductWithCollectionOfComplexProperties()
- {
- string document = GetResourceAsString("SingleProductWithCollectionOfComplexProperties.xml");
- var result = DataServicesHelper.GetData(document);
- Assert.Equal(1, result.Count());
- Assert.Equal(productProperties + 1, result.First().Count);
- var tags = result.First()["Tags"] as IList<dynamic>;
- Assert.Equal(2, tags.Count);
- Assert.Equal("Food", tags[0]["group"]);
- Assert.Equal("Bakery", tags[0]["value"]);
- Assert.Equal("Food", tags[1]["group"]);
- Assert.Equal("Meat", tags[1]["value"]);
- }
-
- private string GetResourceAsString(string resourceName)
- {
- var assembly = Assembly.GetExecutingAssembly();
- var resourceNames = assembly.GetManifestResourceNames();
- string completeResourceName = resourceNames.FirstOrDefault(o => o.EndsWith(resourceName, StringComparison.CurrentCultureIgnoreCase));
- using (Stream resourceStream = assembly.GetManifestResourceStream(completeResourceName))
- {
- TextReader reader = new StreamReader(resourceStream);
- return reader.ReadToEnd();
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using Xunit;
+
+namespace Simple.Data.OData.UnitTests
+{
+ public class DataServicesHelperTests
+ {
+ private const int productProperties = 10;
+ private const int categoryProperties = 4;
+
+ [Fact]
+ public void GetDataParsesSingleProduct()
+ {
+ string document = GetResourceAsString("SingleProduct.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(productProperties, result.First().Count);
+ }
+
+ [Fact]
+ public void GetDataParsesMultipleProducts()
+ {
+ string document = GetResourceAsString("MultipleProducts.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(20, result.Count());
+ Assert.Equal(productProperties, result.First().Count);
+ }
+
+ [Fact]
+ public void GetDataParsesSingleProductWithCategory()
+ {
+ string document = GetResourceAsString("SingleProductWithCategory.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(productProperties + 1, result.First().Count);
+ Assert.Equal(categoryProperties, (result.First()["Category"] as IDictionary<string,object>).Count);
+ }
+
+ [Fact]
+ public void GetDataParsesMultipleProductsWithCategory()
+ {
+ string document = GetResourceAsString("MultipleProductsWithCategory.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(20, result.Count());
+ Assert.Equal(productProperties + 1, result.First().Count);
+ Assert.Equal(categoryProperties, (result.First()["Category"] as IDictionary<string, object>).Count);
+ }
+
+ [Fact]
+ public void GetDataParsesSingleCategoryWithProducts()
+ {
+ string document = GetResourceAsString("SingleCategoryWithProducts.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(categoryProperties + 1, result.First().Count);
+ Assert.Equal(12, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).Count());
+ Assert.Equal(productProperties, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).First().Count);
+ }
+
+ [Fact]
+ public void GetDataParsesMultipleCategoriesWithProducts()
+ {
+ string document = GetResourceAsString("MultipleCategoriesWithProducts.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(8, result.Count());
+ Assert.Equal(categoryProperties + 1, result.First().Count);
+ Assert.Equal(12, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).Count());
+ Assert.Equal(productProperties, (result.First()["Products"] as IEnumerable<IDictionary<string, object>>).First().Count);
+ }
+
+ [Fact]
+ public void GetDataParsesSingleProductWithComplexProperty()
+ {
+ string document = GetResourceAsString("SingleProductWithComplexProperty.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(productProperties + 1, result.First().Count);
+ var quantity = result.First()["Quantity"] as IDictionary<string, object>;
+ Assert.NotNull(quantity);
+ Assert.Equal(10d, quantity["Value"]);
+ Assert.Equal("bags", quantity["Units"]);
+ }
+
+ [Fact]
+ public void GetDataParsesSingleProductWithCollectionOfPrimitiveProperties()
+ {
+ string document = GetResourceAsString("SingleProductWithCollectionOfPrimitiveProperties.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(productProperties + 1, result.First().Count);
+ var tags = result.First()["Tags"] as IList<dynamic>;
+ Assert.Equal(2, tags.Count);
+ Assert.Equal("Bakery", tags[0]);
+ Assert.Equal("Food", tags[1]);
+ }
+
+ [Fact]
+ public void GetDataParsesSingleProductWithCollectionOfComplexProperties()
+ {
+ string document = GetResourceAsString("SingleProductWithCollectionOfComplexProperties.xml");
+ var result = DataServicesHelper.GetData(document);
+ Assert.Equal(1, result.Count());
+ Assert.Equal(productProperties + 1, result.First().Count);
+ var tags = result.First()["Tags"] as IList<dynamic>;
+ Assert.Equal(2, tags.Count);
+ Assert.Equal("Food", tags[0]["group"]);
+ Assert.Equal("Bakery", tags[0]["value"]);
+ Assert.Equal("Food", tags[1]["group"]);
+ Assert.Equal("Meat", tags[1]["value"]);
+ }
+
+ private string GetResourceAsString(string resourceName)
+ {
+ var assembly = Assembly.GetExecutingAssembly();
+ var resourceNames = assembly.GetManifestResourceNames();
+ string completeResourceName = resourceNames.FirstOrDefault(o => o.EndsWith(resourceName, StringComparison.CurrentCultureIgnoreCase));
+ using (Stream resourceStream = assembly.GetManifestResourceStream(completeResourceName))
+ {
+ TextReader reader = new StreamReader(resourceStream);
+ return reader.ReadToEnd();
+ }
+ }
+ }
+}
2  Simple.OData.Test/ExpressionFormatterTest.cs → ...e.Data.OData.UnitTests/ExpressionFormatterTest.cs
View
@@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
-namespace Simple.OData.Test
+namespace Simple.Data.OData.UnitTests
{
using Xunit;
using Simple.Data;
0  Simple.OData.Test/Properties/AssemblyInfo.cs → ...e.Data.OData.UnitTests/Properties/AssemblyInfo.cs
View
File renamed without changes
4,618 ...Test/Resources/MultipleCategoriesWithProducts.xml → ...ests/Resources/MultipleCategoriesWithProducts.xml
View
2,309 additions, 2,309 deletions not shown
1,094 Simple.OData.Test/Resources/MultipleProducts.xml → ...ta.OData.UnitTests/Resources/MultipleProducts.xml
View
@@ -1,548 +1,548 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<feed xml:base="http://services.odata.org/Northwind/Northwind.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
- <title type="text">Products</title>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products</id>
- <updated>2012-02-24T10:22:53Z</updated>
- <link rel="self" title="Products" href="Products" />
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(1)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(1)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(1)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(1)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">1</d:ProductID>
- <d:ProductName>Chai</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">1</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">1</d:CategoryID>
- <d:QuantityPerUnit>10 boxes x 20 bags</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">18.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">39</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">10</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(2)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(2)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(2)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(2)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(2)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">2</d:ProductID>
- <d:ProductName>Chang</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">1</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">1</d:CategoryID>
- <d:QuantityPerUnit>24 - 12 oz bottles</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">19.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">17</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">40</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">25</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(3)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(3)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(3)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(3)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(3)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">3</d:ProductID>
- <d:ProductName>Aniseed Syrup</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">1</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">2</d:CategoryID>
- <d:QuantityPerUnit>12 - 550 ml bottles</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">10.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">13</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">70</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">25</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(4)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(4)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(4)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(4)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(4)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">4</d:ProductID>
- <d:ProductName>Chef Anton's Cajun Seasoning</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">2</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">2</d:CategoryID>
- <d:QuantityPerUnit>48 - 6 oz jars</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">22.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">53</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(5)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(5)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(5)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(5)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(5)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">5</d:ProductID>
- <d:ProductName>Chef Anton's Gumbo Mix</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">2</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">2</d:CategoryID>
- <d:QuantityPerUnit>36 boxes</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">21.3500</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">0</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">true</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(6)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(6)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(6)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(6)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(6)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">6</d:ProductID>
- <d:ProductName>Grandma's Boysenberry Spread</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">3</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">2</d:CategoryID>
- <d:QuantityPerUnit>12 - 8 oz jars</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">25.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">120</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">25</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(7)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(7)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(7)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(7)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(7)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">7</d:ProductID>
- <d:ProductName>Uncle Bob's Organic Dried Pears</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">3</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">7</d:CategoryID>
- <d:QuantityPerUnit>12 - 1 lb pkgs.</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">30.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">15</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">10</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(8)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(8)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(8)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(8)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(8)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">8</d:ProductID>
- <d:ProductName>Northwoods Cranberry Sauce</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">3</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">2</d:CategoryID>
- <d:QuantityPerUnit>12 - 12 oz jars</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">40.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">6</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(9)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(9)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(9)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(9)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(9)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">9</d:ProductID>
- <d:ProductName>Mishi Kobe Niku</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">4</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">6</d:CategoryID>
- <d:QuantityPerUnit>18 - 500 g pkgs.</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">97.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">29</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">true</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(10)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(10)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(10)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(10)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(10)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">10</d:ProductID>
- <d:ProductName>Ikura</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">4</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">8</d:CategoryID>
- <d:QuantityPerUnit>12 - 200 ml jars</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">31.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">31</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(11)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(11)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(11)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(11)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(11)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">11</d:ProductID>
- <d:ProductName>Queso Cabrales</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">5</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">4</d:CategoryID>
- <d:QuantityPerUnit>1 kg pkg.</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">21.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">22</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">30</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">30</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(12)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(12)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(12)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(12)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(12)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">12</d:ProductID>
- <d:ProductName>Queso Manchego La Pastora</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">5</d:SupplierID>
- <d:CategoryID m:type="Edm.Int32">4</d:CategoryID>
- <d:QuantityPerUnit>10 - 500 g pkgs.</d:QuantityPerUnit>
- <d:UnitPrice m:type="Edm.Decimal">38.0000</d:UnitPrice>
- <d:UnitsInStock m:type="Edm.Int16">86</d:UnitsInStock>
- <d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
- <d:ReorderLevel m:type="Edm.Int16">0</d:ReorderLevel>
- <d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
- </m:properties>
- </content>
- </entry>
- <entry>
- <id>http://services.odata.org/Northwind/Northwind.svc/Products(13)</id>
- <title type="text" />
- <updated>2012-02-24T10:22:53Z</updated>
- <author>
- <name />
- </author>
- <link rel="edit" title="Product" href="Products(13)" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(13)/Category" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(13)/Order_Details" />
- <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(13)/Supplier" />
- <category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
- <content type="application/xml">
- <m:properties>
- <d:ProductID m:type="Edm.Int32">13</d:ProductID>
- <d:ProductName>Konbu</d:ProductName>
- <d:SupplierID m:type="Edm.Int32">6</d:SupplierID>
- <d:CategoryID m: