WindowsAzure/azure-mobile-services — pull request #230 by advancedrei (2014-03-09 18:03:28+00:00)
Title: [Managed SDK] Fix Issue #229 plus unit tests

A comprehensive overhaul of the validation logic for table operations.
- Creates an boolean option on MobileServiceClient that preserves the existing behavior Empty string behavior, but makes the logically-correct behavior opt-in.
- Takes control of the ID management from JSON.NET and add manipulates the JObject instance directly during the validation process before the request is sent.
- Avoids the over 350 lines of ID-checking code in MobileServiceSerializer for MobileServiceTable.InsertAsync(JObject) and MobileServiceTable.DeleteAsync(JObject).
- Updates the unit tests to properly handle the above changes, and test for all permutations of valid "EmptyStringIDs".
- Updates many (but not all) of the unit tests to use JSON.NET objects as input values, instead of relying on hard-coded string representations of the expected payload. This will make the unit tests fault-tolerant to potential changes to the JSON.NET serializer, and allows the unit tests to handle string.Empty and (null) properly. The structure used also makes it more obvious when the expected response is an Array or an individual object.
- Adds new common tags to the Unit Tests to make test segmentation easier.

Code is commented with the prefix "// RWM:" where explanations are appropriate.