This repository has been archived by the owner on Feb 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[client][managed][offline] allow underscore and hyphen in queryId
- Loading branch information
Showing
10 changed files
with
72 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sdk/Managed/src/Microsoft.WindowsAzure.MobileServices/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...Microsoft.WindowsAzure.MobileServices.Test.Unit/Table/Sync/MobileServiceSyncTableTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Microsoft.WindowsAzure.MobileServices.Sync; | ||
|
||
namespace Microsoft.WindowsAzure.MobileServices.Test.Unit.Table.Sync | ||
{ | ||
[TestClass] | ||
public class MobileServiceSyncTableTests | ||
{ | ||
[TestMethod] | ||
public void ValidateQueryId_Throws_OnInvalidId() | ||
{ | ||
var testCases = new[] { "-myitems", "_myitems", "|myitems", "s|myitems", "asdf@#$!@" }; | ||
foreach (var queryId in testCases) | ||
{ | ||
var ex = AssertEx.Throws<ArgumentException>(() => MobileServiceSyncTable.ValidateQueryId(queryId)); | ||
Assert.AreEqual(ex.Message, "The query id must start with a letter and can contain only letters, digits, hyphen or underscore."); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ValidateQueryId_Succeeds_OnValidId() | ||
{ | ||
var testCases = new[] { "myitems1", "myItems_yourItems1", "my-items123" }; | ||
foreach (var queryId in testCases) | ||
{ | ||
MobileServiceSyncTable.ValidateQueryId(queryId); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters