public void TryGetValueWhenKeyDoesNotExistTest() { // Arrange var dict = new InsertOrderedDictionary <int, string> { { 2, "3" }, { 3, "4" }, { 4, "5" }, { 5, "1" }, { 1, "2" } }; // Act string actualValue; var actualExists = dict.TryGetValue(6, out actualValue); // Assert Assert.IsFalse(actualExists); Assert.IsNull(actualValue); }
public void TryGetValueWhenKeyExistsTest() { // Arrange var dict = new InsertOrderedDictionary <int, string> { { 2, "3" }, { 3, "4" }, { 4, "5" }, { 5, "1" }, { 1, "2" } }; // Act string actualValue; var actualExists = dict.TryGetValue(4, out actualValue); // Assert Assert.IsTrue(actualExists); Assert.AreEqual("5", actualValue); }
public void TryGetValueWhenKeyDoesNotExistTest() { // Arrange var dict = new InsertOrderedDictionary<int, string> { {2, "3"}, {3, "4"}, {4, "5"}, {5, "1"}, {1, "2"} }; // Act string actualValue; var actualExists = dict.TryGetValue(6, out actualValue); // Assert Assert.IsFalse(actualExists); Assert.IsNull(actualValue); }
public void TryGetValueWhenKeyExistsTest() { // Arrange var dict = new InsertOrderedDictionary<int, string> { {2, "3"}, {3, "4"}, {4, "5"}, {5, "1"}, {1, "2"} }; // Act string actualValue; var actualExists = dict.TryGetValue(4, out actualValue); // Assert Assert.IsTrue(actualExists); Assert.AreEqual("5", actualValue); }