Exemplo n.º 1
0
 IList <NodeRule <MessageInfo, DefaultLinkStyle> > IGraphvizTheme <DefaultLinkStyle> .DefaultNodeRules()
 {
     return(new List <NodeRule <MessageInfo, DefaultLinkStyle> >()
     {
         ThemeNodeRules.SetComments,
         ThemeNodeRules.SetLabel,
         TTLAttribute.GetRule(),
         ServiceNameAttribute.GetRule(),
         TagsAttribute.GetRule(),
         TagsAltAttribute.GetRule(),
         LabelAltAttribute.GetRule(),
     });
 }
Exemplo n.º 2
0
        public async Task IApiActionAttributeTest()
        {
            var context = new TestActionContext(
                httpApi: null,
                httpApiConfig: new HttpApiConfig {
                HttpHost = new Uri("http://www.mywebapi.com")
            },
                apiActionDescriptor: new ApiActionDescriptor(typeof(IMyApi).GetMethod("PostAsync")));

            var attr = new TagsAttribute("key", "laojiu");
            await attr.BeforeRequestAsync(context);

            Assert.Equal("laojiu", context.Tags.Get("key").As <string>());
        }
Exemplo n.º 3
0
        public async Task IApiActionAttributeTest()
        {
            var context = new ApiActionContext
            {
                RequestMessage = new HttpApiRequestMessage
                {
                    RequestUri = new Uri("http://www.mywebapi.com"),
                    Method     = HttpMethod.Post
                },
                ApiActionDescriptor = ApiDescriptorCache.GetApiActionDescriptor(typeof(IMyApi).GetMethod("PostAsync"))
            };

            var attr = new TagsAttribute("key", "laojiu");
            await attr.BeforeRequestAsync(context);

            Assert.Equal("laojiu", context.Tags.Get("key").As <string>());
        }