コード例 #1
0
ファイル: ContextBase.cs プロジェクト: mr-sandy/kola
        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()
             }
         }
     });
 }