public void ReturnsCorrectResultForArray() { // Given MetadataDictionary initialMetadata = new MetadataDictionary {["A"] = new[] {1, 2, 3}}; MetadataStack metadata = new MetadataStack(initialMetadata); // When IReadOnlyList<int> result = metadata.List<int>("A"); // Then Assert.IsNotNull(result); CollectionAssert.AreEqual(result, new[] {1, 2, 3}); }
public void ReturnsCorrectResultForConvertedIntList() { // Given MetadataDictionary initialMetadata = new MetadataDictionary {["A"] = new List<int> {1, 2, 3}}; MetadataStack metadata = new MetadataStack(initialMetadata); // When IReadOnlyList<string> result = metadata.List<string>("A"); // Then Assert.IsNotNull(result); CollectionAssert.AreEqual(result, new[] {"1", "2", "3"}); }