예제 #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 ComponentTypeResource Build(IComponentSpecification<IComponentWithProperties> component)
 {
     return new ComponentTypeResource
         {
             Name = component.Name,
             Category = component.Category,
             Type = component.Accept(this.namingVisitor),
             Links = new[]
                 {
                     new LinkResource { Rel = "self", Href = "/_kola/component-types/" + component.Name.Urlify() }
                 }
         };
 }
예제 #3
0
 public ComponentTypeResource Build(IComponentSpecification <IComponentWithProperties> component)
 {
     return(new ComponentTypeResource
     {
         Name = component.Name,
         Category = component.Category,
         Type = component.Accept(this.namingVisitor),
         Links = new[]
         {
             new LinkResource {
                 Rel = "self", Href = "/_kola/component-types/" + component.Name.Urlify()
             }
         }
     });
 }