Пример #1
0
        public void EstablishBaseContext()
        {
            this.Template = new Template(new[] { "path" });

            this.ComponentLibrary = MockRepository.GenerateStub<IComponentSpecificationLibrary>();

            this.ComponentSpecification = MockRepository.GenerateStub<IComponentSpecification<IComponentWithProperties>>();

            this.ComponentLibrary.Stub(l => l.Lookup(Arg<string>.Is.Anything)).Return(this.ComponentSpecification);

            this.Visitor = new AmendmentApplyingVisitor(this.Template, this.ComponentLibrary);
        }
Пример #2
0
        public void ApplyAmendments(IComponentSpecificationLibrary componentLibrary, bool reset = false)
        {
            var visitor = new AmendmentApplyingVisitor(this, componentLibrary);

            foreach (var amendment in this.amendments)
            {
                amendment.Accept(visitor);
            }

            if (reset)
            {
                this.amendments.Clear();
            }
        }