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

            var parents = path.Parents();

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

            var parents = path.Parents();

            Assert.Single(parents);
        }
Beispiel #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()));
        }
Beispiel #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);
        }