|
4 | 4 | public sealed class EntryInfoTests
|
5 | 5 | {
|
6 | 6 | [TestMethod]
|
7 |
| - [DataRow("MultipleStorage.cfs", 1)] |
8 |
| - [DataRow("TestStream_v3_0.cfs", 1)] |
9 |
| - [DataRow("TestStream_v4_0.cfs", 1)] |
10 |
| - public void EnumerateEntryInfos(string fileName, int count) |
| 7 | + [DataRow("MultipleStorage.cfs", EntryType.Storage, "MyStorage", "/Root Entry")] |
| 8 | + [DataRow("TestStream_v3_0.cfs", EntryType.Stream, "TestStream", "/Root Entry")] |
| 9 | + [DataRow("TestStream_v4_0.cfs", EntryType.Stream, "TestStream", "/Root Entry")] |
| 10 | + public void EnumerateEntryInfos(string fileName, EntryType type, string name, string path) |
11 | 11 | {
|
12 | 12 | using var rootStorage = RootStorage.OpenRead(fileName);
|
13 | 13 | IEnumerable<EntryInfo> entries = rootStorage.EnumerateEntries();
|
14 |
| - Assert.AreEqual(count, entries.Count()); |
| 14 | + Assert.AreEqual(1, entries.Count()); |
| 15 | + |
| 16 | + EntryInfo entry = entries.First(); |
| 17 | + Assert.AreEqual(type, entry.Type); |
| 18 | + Assert.AreEqual(name, entry.Name); |
| 19 | + Assert.AreEqual(path, entry.Path); |
| 20 | + Assert.AreEqual(Guid.Empty, entry.CLSID); |
| 21 | + Assert.AreEqual(0, entry.Length); |
| 22 | + if (type is EntryType.Storage) |
| 23 | + { |
| 24 | + Assert.AreNotEqual(DirectoryEntry.ZeroFileTime, entry.CreationTime); |
| 25 | + Assert.AreNotEqual(DirectoryEntry.ZeroFileTime, entry.ModifiedTime); |
| 26 | + } |
| 27 | + else |
| 28 | + { |
| 29 | + Assert.AreEqual(DirectoryEntry.ZeroFileTime, entry.CreationTime); |
| 30 | + Assert.AreEqual(DirectoryEntry.ZeroFileTime, entry.ModifiedTime); |
| 31 | + } |
15 | 32 | }
|
16 | 33 | }
|
0 commit comments