Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][wasm][tests] Add tests for Map #38862

Merged
merged 3 commits into from
Jul 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments
  • Loading branch information
kjpou1 committed Jul 7, 2020
commit 54a53aaee092a01f34b5613ddbe17d4f88b3e30c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public static void Add_ClearRepeatedly()
{
for (int j = 0; j < Count; j++)
{
string key = "Key: i=" + i + ", j=" + j;
string value = "Value: i=" + i + ", j=" + j;
string key = $"Key: i={i}, j={j}";
string value = $"Value: i={i}, j={j}";
hash.Add(key, value);
}

Expand All @@ -138,7 +138,7 @@ public static void ContainsKey()
{
for (int i = 0; i < map2.Count; i++)
{
string key = "Key_" + i;
string key = $"Key_{i}";
Assert.True(map2.Contains(key));
}

Expand All @@ -159,7 +159,7 @@ public static void RemoveKey()
{
for (int i = 0; i < map2.Count; i++)
{
string key = "Key_" + i;
string key = $"Key_{i}";
Assert.True(map2.Contains(key));
}
Assert.Equal(map2.Count, map2.Keys.Count);
Expand All @@ -180,8 +180,8 @@ public static void ContainsValue()
{
for (int i = 0; i < map2.Count; i++)
{
string value = "Value_" + i;
Assert.True(map2["Key_" + i].ToString() == value);
string value = $"Value_{i}";
Assert.True(map2[$"Key_{i}"].ToString() == value);
}
Assert.True(map2["Non Existent Value"] == null);
Assert.True(map2[101] == null);
Expand All @@ -201,8 +201,8 @@ public static Map CreateStringMap(int count, int start = 0)

for (int i = start; i < start + count; i++)
{
string key = "Key_" + i;
string value = "Value_" + i;
string key = $"Key_{i}";
string value = $"Value_{i}";

map.Add(key, value);
}
Expand Down