Skip to content

Instantly share code, notes, and snippets.

@onyxmaster
Last active June 7, 2023 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onyxmaster/caa6652929ea9442c1528d8af92524bd to your computer and use it in GitHub Desktop.
Save onyxmaster/caa6652929ea9442c1528d8af92524bd to your computer and use it in GitHub Desktop.
[Fact]
public void DictionaryPreservesInsertionOrder()
{
var dictionary = new Dictionary<int, int>();
dictionary.Add(0, 0);
dictionary.Add(1, 1);
dictionary.Remove(0);
dictionary.Add(2, 2);
Assert.Equal(new int[] { 1, 2 }, dictionary.Keys);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment