示例#1
0
        public void GetParents_WithAParent_DoesNotReturnSelf()
        {
            var path = new MockPath(@"C:\nemec");

            var parents = path.Parents();

            Assert.AreEqual(1, parents.Count());
        }
示例#2
0
        public void GetParents_WithAParent_DoesNotReturnSelf()
        {
            var path = new MockPath(@"C:\nemec");

            var parents = path.Parents();

            Assert.Single(parents);
        }
示例#3
0
        public void GetParents_WithMultipleParents_ReturnsTheParentsFromMostToLeastSpecific()
        {
            var path = new MockPath(@"C:\users\nemec");

            var expected = new[]
            {
                new MockPath(@"C:\users"), new MockPath(@"C:\")
            };

            Assert.True(expected.SequenceEqual(path.Parents()));
        }
示例#4
0
        public void GetParents_WithAParent_ReturnsTheParent()
        {
            var path = new MockPath(@"C:\nemec");

            var expected = new MockPath(@"C:\");

            var parents = path.Parents().GetEnumerator();

            parents.MoveNext();
            var actual = parents.Current;

            Assert.AreEqual(expected, actual);
        }