Exemple #1
0
        public void push()
        {
            var path1 = new TPath("s1/s2/s3/t1");
            TPath path2 = path1.Push("top");

            path2.Locator.ShouldEqual("top/s1/s2/s3/t1");
        }
Exemple #2
0
        public Test AddTest(string testPath)
        {
            var path = new TPath(testPath);

            var test = new Test(path.Name);
            Suite suite = path.IsEnd ? this : findOrCreateSuite(path.ToSuite());
            suite.AddTest(test);

            return test;
        }
Exemple #3
0
        private Test FindTest(TPath path)
        {
            if (path.IsEnd)
            {
                return(_tests.FirstOrDefault(x => x.Name == path.Name));
            }

            Suite child = FindSuite(path.Next);

            return(child == null ? null : child.FindTest(path.Pop()));
        }
Exemple #4
0
        public Suite FindSuite(TPath path)
        {
            if (path.IsEnd)
            {
                return(_suites.FirstOrDefault(x => x.Name == path.Name));
            }

            Suite child = FindSuite(path.Next);

            return(child == null ? null : child.FindSuite(path.Pop()));
        }
Exemple #5
0
        public Test AddTest(string testPath)
        {
            var path = new TPath(testPath);

            var   test  = new Test(path.Name);
            Suite suite = path.IsEnd ? this : findOrCreateSuite(path.ToSuite());

            suite.AddTest(test);

            return(test);
        }
Exemple #6
0
        protected Suite findOrCreateSuite(TPath path)
        {
            Suite child = FindSuite(path.Next);

            if (child == null)
            {
                child = new Suite(path.Next);
                AddSuite(child);
            }

            return(path.IsEnd ? child : child.findOrCreateSuite(path.Pop()));
        }
Exemple #7
0
        public virtual TPath GetPath()
        {
            var   path   = new TPath(Name);
            Suite parent = Parent;

            while (parent.IsSuite())
            {
                path   = path.Push(parent.Name);
                parent = parent.Parent;
            }

            return(path);
        }
        public TPath GetPath()
        {
            var path = new TPath(Name);

            if (Parent != null)
            {
                path = path.Push(Parent.Name);
            }

            return path;
        }
        public IFixtureNode Find(TPath path)
        {
            if (path.IsRoot)
            {
                return this;
            }

            FixtureGraph fixture = FixtureFor(path.Next);

            return path.IsEnd ? fixture : (IFixtureNode) fixture.GrammarFor(path.Pop().Next);
        }
Exemple #10
0
 public bool Equals(TPath obj)
 {
     return !ReferenceEquals(null, obj) && Locator.Equals(obj.Locator);
 }
Exemple #11
0
 public void locator()
 {
     var path1 = new TPath("s1/s2/s3/t1");
     path1.Locator.ShouldEqual("s1/s2/s3/t1");
 }
Exemple #12
0
 public void append()
 {
     var path = new TPath("s1/s2/s3");
     path.Append("t1").Locator.ShouldEqual("s1/s2/s3/t1");
 }
Exemple #13
0
 public void an_empty_string_path_is_the_hierarchy()
 {
     var path = new TPath(string.Empty);
     path.Locator.ShouldEqual(string.Empty);
 }
Exemple #14
0
        public Test FindTest(string name)
        {
            var path = new TPath(name);

            return(FindTest(path));
        }
Exemple #15
0
        public Suite FindSuite(string name)
        {
            var path = new TPath(name);

            return(FindSuite(path));
        }
Exemple #16
0
 public bool Equals(TPath obj)
 {
     return(!ReferenceEquals(null, obj) && Locator.Equals(obj.Locator));
 }