public void ReturnsCorrectDirectoryPathForString(string path, string expected) { // Given MetadataDictionary initialMetadata = new MetadataDictionary(); MetadataStack metadata = new MetadataStack(initialMetadata); // When metadata = metadata.Clone(new[] { new KeyValuePair<string, object>("A", path) }); object result = metadata.DirectoryPath("A"); // Then if (expected == null) { Assert.IsNull(result); } else { Assert.IsInstanceOf<DirectoryPath>(result); Assert.AreEqual(expected, ((DirectoryPath)result).FullPath); } }