public DescriptionTextWriter(Description description)
 {
     if (!description.IsMultiLevel())
     {
         _report.AddText(description.ToString());
     }
     else
     {
         description.AcceptVisitor(this);
     }
 }
Пример #2
0
 public DescriptionTextWriter(Description description)
 {
     if (!description.IsMultiLevel())
     {
         _report.AddText(description.ToString());
     }
     else
     {
         description.AcceptVisitor(this);
     }
 }
Пример #3
0
 public DescriptionTextWriter(Description description)
 {
     if (description.IsMultiLevel())
     {
         description.AcceptVisitor(this);
     }
     else
     {
         this.As<IDescriptionVisitor>().Start(description);
     }
 }
Пример #4
0
 public DescriptionTextWriter(Description description)
 {
     if (description.IsMultiLevel())
     {
         description.AcceptVisitor(this);
     }
     else
     {
         this.As <IDescriptionVisitor>().Start(description);
     }
 }
Пример #5
0
        public void accept_visitor_if_it_only_has_itself()
        {
            var repo = new MockRepository();
            var visitor = repo.StrictMock<IDescriptionVisitor>();

            var description = new Description();

            using (repo.Record())
            {
                visitor.Start(description);
                visitor.End();
            }

            using (repo.Playback())
            {
                description.AcceptVisitor(visitor);
            }
        }
Пример #6
0
        public void accept_visitory_with_multiple_bullet_lists()
        {
            var repo = new MockRepository();
            var visitor = repo.StrictMock<IDescriptionVisitor>();

            var description = new Description();

            var list = new BulletList();
            list.Children.Add(new Description());
            list.Children.Add(new Description());
            list.Children.Add(new Description());

            description.BulletLists.Add(list);
            description.BulletLists.Add(new BulletList());

            using (repo.Record())
            {
                visitor.Start(description);

                visitor.StartList(list);

                visitor.Start(list.Children[0]);
                visitor.End();

                visitor.Start(list.Children[1]);
                visitor.End();

                visitor.Start(list.Children[2]);
                visitor.End();

                visitor.EndList();

                visitor.StartList(description.BulletLists.Last());
                visitor.EndList();

                visitor.End();
            }

            using (repo.Playback())
            {
                description.AcceptVisitor(visitor);
            }
        }