-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for list value in metadata
- Loading branch information
1 parent
7962768
commit 008d0af
Showing
3 changed files
with
44 additions
and
1 deletion.
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
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 NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace CloudinaryDotNet.Test.Util | ||
{ | ||
[TestFixture] | ||
public class StringDictionaryTest | ||
{ | ||
[Test] | ||
public void TestStringDictionaryAddListValue() | ||
{ | ||
var sd = new StringDictionary(); | ||
|
||
sd.Add("k1", new List<string>{"v11", "v12"}); | ||
sd.Add("k2", new List<string>{"v21", "v22"}); | ||
|
||
Assert.AreEqual("k1=[\"v11\",\"v12\"]|k2=[\"v21\",\"v22\"]", Utils.SafeJoin("|", sd.SafePairs)); | ||
} | ||
|
||
[Test] | ||
public void TestStringDictionaryAddListValueSpecialCharacters() | ||
{ | ||
var sd = new StringDictionary(); | ||
|
||
sd.Add("k1", new List<string>{"v11|=\"'!@#$%^*({}[]"}); | ||
|
||
Assert.AreEqual(@"k1=[""v11\|\=\""'!@#$%^*({}[]""]", Utils.SafeJoin("|", sd.SafePairs)); | ||
} | ||
} | ||
} |
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