Permalink
Browse files

Refactoring.

  • Loading branch information...
object committed Sep 26, 2012
1 parent 2306d6a commit 6f600edbea20e8cfc782f0972244d88da7ea7680
Showing with 115 additions and 10,134 deletions.
  1. +3 −3 CommonAssemblyInfo.cs
  2. +0 −6 Simple.Data.OData.IntegrationTests/App.config
  3. +0 −33 Simple.Data.OData.IntegrationTests/DeleteTest.cs
  4. +0 −34 Simple.Data.OData.IntegrationTests/EntityPluralizer.cs
  5. +0 −84 Simple.Data.OData.IntegrationTests/FindAllTest.cs
  6. +0 −123 Simple.Data.OData.IntegrationTests/FindAssociationTest.cs
  7. +0 −67 Simple.Data.OData.IntegrationTests/FindExpandTest.cs
  8. +0 −76 Simple.Data.OData.IntegrationTests/FindExtraClausesTest.cs
  9. +0 −86 Simple.Data.OData.IntegrationTests/FindOneTest.cs
  10. +0 −31 Simple.Data.OData.IntegrationTests/FunctionTest.cs
  11. +0 −30 Simple.Data.OData.IntegrationTests/GetTest.cs
  12. +0 −75 Simple.Data.OData.IntegrationTests/InsertTest.cs
  13. +0 −12 Simple.Data.OData.IntegrationTests/Properties/AssemblyInfo.cs
  14. +0 −117 Simple.Data.OData.IntegrationTests/SchemaTest.cs
  15. +0 −125 Simple.Data.OData.IntegrationTests/Simple.Data.OData.IntegrationTests.csproj
  16. +0 −23 Simple.Data.OData.IntegrationTests/SpecialTest.cs
  17. +0 −34 Simple.Data.OData.IntegrationTests/TestBase.cs
  18. +0 −57 Simple.Data.OData.IntegrationTests/TestService.cs
  19. +0 −198 Simple.Data.OData.IntegrationTests/TransactionTest.cs
  20. +0 −98 Simple.Data.OData.IntegrationTests/UpdateTest.cs
  21. +0 −10 Simple.Data.OData.IntegrationTests/packages.config
  22. +0 −129 Simple.Data.OData.UnitTests/DataServicesHelperTests.cs
  23. +0 −156 Simple.Data.OData.UnitTests/ExpressionFormatterTest.cs
  24. +0 −12 Simple.Data.OData.UnitTests/Properties/AssemblyInfo.cs
  25. +0 −2,310 Simple.Data.OData.UnitTests/Resources/MultipleCategoriesWithProducts.xml
  26. +0 −548 Simple.Data.OData.UnitTests/Resources/MultipleProducts.xml
  27. +0 −988 Simple.Data.OData.UnitTests/Resources/MultipleProductsWithCategory.xml
  28. +0 −353 Simple.Data.OData.UnitTests/Resources/SingleCategoryWithProducts.xml
  29. +0 −28 Simple.Data.OData.UnitTests/Resources/SingleProduct.xml
  30. +0 −50 Simple.Data.OData.UnitTests/Resources/SingleProductWithCategory.xml
  31. +0 −38 Simple.Data.OData.UnitTests/Resources/SingleProductWithCollectionOfComplexProperties.xml
  32. +0 −32 Simple.Data.OData.UnitTests/Resources/SingleProductWithCollectionOfPrimitiveProperties.xml
  33. +0 −32 Simple.Data.OData.UnitTests/Resources/SingleProductWithComplexProperty.xml
  34. +0 −98 Simple.Data.OData.UnitTests/Simple.Data.OData.UnitTests.csproj
  35. +0 −5 Simple.Data.OData.UnitTests/packages.config
  36. +0 −99 Simple.Data.OData/BatchRequestBuilder.cs
  37. +0 −41 Simple.Data.OData/BatchRequestRunner.cs
  38. +3 −4 Simple.Data.OData/CommandBuilder.cs
  39. +0 −41 Simple.Data.OData/CommandRequestBuilder.cs
  40. +0 −86 Simple.Data.OData/CommandRequestRunner.cs
  41. +0 −292 Simple.Data.OData/Edm/EdmHelper.cs
  42. +0 −123 Simple.Data.OData/Edm/EdmPropertyType.cs
  43. +0 −140 Simple.Data.OData/Edm/EdmSchema.cs
  44. +0 −119 Simple.Data.OData/Edm/EdmType.cs
  45. +2 −38 Simple.Data.OData/ExpressionFormatter.cs
  46. +0 −1 Simple.Data.OData/FunctionNameConverter.cs
  47. +0 −87 Simple.Data.OData/HttpCommand.cs
  48. +8 −29 Simple.Data.OData/ODataAdapterTransaction.cs
  49. +0 −343 Simple.Data.OData/ODataClient.cs
  50. +34 −10 Simple.Data.OData/ODataTableAdapter.cs
  51. +2 −1 Simple.Data.OData/ODataTableAdapterWithFunctions.cs
  52. +2 −1 Simple.Data.OData/ODataTableAdapterWithTransactions.cs
  53. +1 −2 Simple.Data.OData/Properties/AssemblyInfo.cs
  54. +0 −94 Simple.Data.OData/Properties/Resources.Designer.cs
  55. +0 −127 Simple.Data.OData/Properties/Resources.resx
  56. +0 −35 Simple.Data.OData/RequestBuilder.cs
  57. +0 −267 Simple.Data.OData/RequestExecutor.cs
  58. +0 −56 Simple.Data.OData/RequestRunner.cs
  59. +0 −13 Simple.Data.OData/Resources/DataServicesAtomEntryXml.txt
  60. +0 −3 Simple.Data.OData/Resources/DataServicesMetadataEntryXml.txt
  61. +0 −18 Simple.Data.OData/RestVerbs.cs
  62. +0 −57 Simple.Data.OData/Schema/Association.cs
  63. +0 −42 Simple.Data.OData/Schema/AssociationCollection.cs
  64. +0 −33 Simple.Data.OData/Schema/Column.cs
  65. +0 −42 Simple.Data.OData/Schema/ColumnCollection.cs
  66. +0 −89 Simple.Data.OData/Schema/DatabaseSchema.cs
  67. +0 −66 Simple.Data.OData/Schema/Function.cs
  68. +0 −44 Simple.Data.OData/Schema/FunctionCollection.cs
  69. +0 −16 Simple.Data.OData/Schema/ISchemaProvider.cs
  70. +0 −27 Simple.Data.OData/Schema/Key.cs
  71. +0 −119 Simple.Data.OData/Schema/SchemaProvider.cs
  72. +0 −123 Simple.Data.OData/Schema/Table.cs
  73. +0 −63 Simple.Data.OData/Schema/TableCollection.cs
  74. +4 −45 Simple.Data.OData/Simple.Data.OData.csproj
  75. +1 −0 Simple.Data.OData/Simple.Data.OData.nuspec
  76. +2 −3 Simple.Data.OData/SimpleReferenceFormatter.cs
  77. +0 −72 Simple.Data.OData/TableServiceException.cs
  78. +0 −17 Simple.NExtLib.Unit/ContainTest.cs
  79. +0 −17 Simple.NExtLib.Unit/EqualTest.cs
  80. +0 −11 Simple.NExtLib.Unit/GenericBinaryTest.cs
  81. +0 −12 Simple.NExtLib.Unit/IBinaryTest.cs
  82. +0 −12 Simple.NExtLib.Unit/IEnumerableTest.cs
  83. +0 −36 Simple.NExtLib.Unit/Properties/AssemblyInfo.cs
  84. +0 −49 Simple.NExtLib.Unit/ShouldExtensions.cs
  85. +0 −69 Simple.NExtLib.Unit/Simple.NExtLib.Unit.csproj
  86. +0 −13 Simple.NExtLib.Unit/TestBase.cs
  87. +0 −4 Simple.NExtLib.Unit/packages.config
  88. +0 −20 Simple.NExtLib.UnitTests/DateTimeExtensionsTests.cs
  89. +0 −27 Simple.NExtLib.UnitTests/Linq/EnumerableExtensionTests.cs
  90. +0 −36 Simple.NExtLib.UnitTests/Properties/AssemblyInfo.cs
  91. +0 −139 Simple.NExtLib.UnitTests/Properties/Resources.Designer.cs
  92. +0 −134 Simple.NExtLib.UnitTests/Properties/Resources.resx
  93. +0 −78 Simple.NExtLib.UnitTests/Resources/TwitterStatusesSample.txt
  94. +0 −9 Simple.NExtLib.UnitTests/Resources/XmlWithDefaultNamespace.txt
  95. +0 −9 Simple.NExtLib.UnitTests/Resources/XmlWithNoNamespace.txt
  96. +0 −9 Simple.NExtLib.UnitTests/Resources/XmlWithPrefixedNamespace.txt
  97. +0 −101 Simple.NExtLib.UnitTests/Simple.NExtLib.UnitTests.csproj
  98. +0 −30 Simple.NExtLib.UnitTests/StringExtensionTests.cs
  99. +0 −44 Simple.NExtLib.UnitTests/Xml/Linq/XElementExtensionsTests.cs
  100. +0 −36 Simple.NExtLib.UnitTests/Xml/XmlAttributesAsDictionaryReadTests.cs
  101. +0 −42 Simple.NExtLib.UnitTests/Xml/XmlAttributesAsDictionaryWriteTests.cs
  102. +0 −46 Simple.NExtLib.UnitTests/Xml/XmlElementAsDictionaryReadTests.cs
  103. +0 −93 Simple.NExtLib.UnitTests/Xml/XmlElementAsDictionaryWriteTests.cs
  104. +0 −4 Simple.NExtLib.UnitTests/packages.config
  105. +1 −1 Simple.OData.Client/BatchRequestBuilder.cs
  106. +1 −1 Simple.OData.Client/BatchRequestRunner.cs
  107. +1 −1 Simple.OData.Client/CommandRequestBuilder.cs
  108. +1 −1 Simple.OData.Client/CommandRequestRunner.cs
  109. +1 −1 Simple.OData.Client/Edm/EdmHelper.cs
  110. +0 −1 Simple.OData.Client/Edm/EdmPropertyType.cs
  111. +1 −1 Simple.OData.Client/Extensions/HomogenizeEx.cs
  112. +1 −1 Simple.OData.Client/Extensions/StringExtensions.cs
  113. +1 −1 Simple.OData.Client/ODataHelper.cs
  114. +2 −0 Simple.OData.Client/Properties/AssemblyInfo.cs
  115. +1 −1 Simple.OData.Client/RequestBuilder.cs
  116. +1 −1 Simple.OData.Client/RequestRunner.cs
  117. +41 −14 Simple.OData.sln
View
@@ -19,6 +19,6 @@
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.5.2.0")]
-[assembly: AssemblyFileVersion("0.5.2.0")]
-[assembly: AssemblyInformationalVersion("0.5.2.0")]
+[assembly: AssemblyVersion("0.6.0.0")]
+[assembly: AssemblyFileVersion("0.6.0.0")]
+[assembly: AssemblyInformationalVersion("0.6.0.0")]
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <connectionStrings>
- <add name="NorthwindEntities" connectionString="metadata=res://*/Northwind.csdl|res://*/Northwind.ssdl|res://*/Northwind.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&quot;Data Source=Northwind.sdf&quot;" providerName="System.Data.EntityClient" />
- </connectionStrings>
-</configuration>
@@ -1,33 +0,0 @@
-using Xunit;
-
-namespace Simple.Data.OData.IntegrationTests
-{
- public class DeleteTest : TestBase
- {
- [Fact]
- public void Delete()
- {
- var product = _db.Products.Insert(ProductName: "Test1", UnitPrice: 18m);
- product = _db.Products.FindByProductName("Test1");
- Assert.NotNull(product);
-
- _db.Products.Delete(ProductName: "Test1");
-
- product = _db.Products.FindByProductName("Test1");
- Assert.Null(product);
- }
-
- [Fact]
- public void DeleteObject()
- {
- var product = _db.Products.Insert(ProductName: "Test2", UnitPrice: 18m);
- product = _db.Products.FindByProductName("Test2");
- Assert.NotNull(product);
-
- _db.Products.Delete(product);
-
- product = _db.Products.FindByProductName("Test2");
- Assert.Null(product);
- }
- }
-}
@@ -1,34 +0,0 @@
-using System.Data.Entity.Design.PluralizationServices;
-using System.Globalization;
-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);
- }
- }
-}
@@ -1,84 +0,0 @@
-using System.Collections.Generic;
-using Xunit;
-
-namespace Simple.Data.OData.IntegrationTests
-{
- 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);
- }
- }
-}
@@ -1,123 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Simple.Data.OData.IntegrationTests
-{
- public class FindAssociationTest : TestBase
- {
- [Fact]
- public void FindAllProductsFromCategory()
- {
- // expected request: Products?$filter=Category/CategoryName+eq+%27Beverages%27
- IEnumerable<dynamic> products = _db.Products.FindAll(_db.Products.Category.CategoryName == "Beverages");
-
- Assert.NotEmpty(products);
- foreach (var product in products)
- {
- Assert.True(product.ProductID > 0);
- Assert.Equal(1, product.CategoryID);
- }
- }
-
- [Fact]
- public void FindAllEmployeesFromSuperior()
- {
- // 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 == "Andrew" && _db.Employees.Superior.LastName == "Fuller");
-
- Assert.NotEmpty(employees);
- foreach (var employee in employees)
- {
- Assert.True(employee.EmployeeID > 0);
- Assert.Equal(2, employee.ReportsTo);
- }
- }
-
- [Fact]
- public void FindAllOrdersFromEmployee()
- {
- // 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);
- foreach (var order in orders)
- {
- Assert.Equal(2, order.EmployeeID);
- }
- }
-
- [Fact]
- public void FindAllCustomerOrders()
- {
- // expected request: Customers('ALFKI')/Orders
- IEnumerable<dynamic> orders = _db.Customers.Orders.FindAll(_db.Customers.CustomerID == "ALFKI");
-
- Assert.NotEmpty(orders);
- foreach (var order in orders)
- {
- Assert.True(order.OrderID > 0);
- Assert.Equal("ALFKI", order.CustomerID);
- }
- }
-
- [Fact]
- public void FindAllOrderOrderDetails()
- {
- // expected request: Orders(10952)/OrderDetails
- IEnumerable<dynamic> orderDetails = _db.Orders.OrderDetails.FindAll(_db.Orders.OrderID == 10952);
-
- Assert.NotEmpty(orderDetails);
- foreach (var details in orderDetails)
- {
- Assert.True(details.ProductID > 0);
- Assert.Equal(10952, details.OrderID);
- }
- }
-
- [Fact]
- public void FindAllEmployeeSubordinates()
- {
- // expected request: Employees(1)/Subordinates
- IEnumerable<dynamic> subordinates = _db.Employees.Subordinates.FindAll(_db.Employees.EmployeeID == 2);
-
- Assert.NotEmpty(subordinates);
- foreach (var subordinate in subordinates)
- {
- Assert.True(subordinate.EmployeeID > 0);
- Assert.Equal(2, subordinate.ReportsTo);
- }
- }
-
- [Fact]
- public void GetEmployeeSuperior()
- {
- // expected request: Employees(1)/Superior
- var superior = _db.Employees.Superior.Get(1);
-
- Assert.NotNull(superior);
- Assert.Equal(2, superior.EmployeeID);
- }
-
- [Fact]
- public void FindEmployeeSuperior()
- {
- // expected request: Employees(1)/Superior
- var superior = _db.Employees.Superior.Find(_db.Employees.EmployeeID == 1);
-
- Assert.NotNull(superior);
- Assert.Equal(2, superior.EmployeeID);
- }
-
- [Fact]
- public void FindAllEmployeeSuperiors()
- {
- // expected request: Employees(1)/Superior
- IEnumerable<dynamic> superiors = _db.Employees.Superior.FindAll(_db.Employees.EmployeeID == 1);
-
- Assert.NotEmpty(superiors);
- Assert.Equal(1, superiors.Count());
- Assert.Equal(2, superiors.First().EmployeeID);
- }
- }
-}
@@ -1,67 +0,0 @@
-using Xunit;
-
-namespace Simple.Data.OData.IntegrationTests
-{
- 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);
- Assert.True(employees[1].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);
- }
- }
-}
Oops, something went wrong.

0 comments on commit 6f600ed

Please sign in to comment.