コード例 #1
0
        public static string GetContextHandlerSignatures <T>(string header) where T : ITemplateContextHandler
        {
            var provider       = new TemplateContextHandlerPackageProvider <T>(BuildTemplateHandler(null), null);
            var handlers       = provider.GetHandlers();
            var splittedResult =
                Enumerable.Repeat(header, 1)
                .Concat(handlers.Select(m => m.Signature));
            var result = string.Join(NEW_LINE_CHAR, splittedResult);

            return(result);
        }
コード例 #2
0
        public void Success_when_start_context_word_does_not_contains_other_start_context_word()
        {
            var provider = new TemplateContextHandlerPackageProvider <AbstractTemplateContextHandler>(BuildTemplateHandler(null), null); //TODO Add Interface Liskov Principle with TemplateHandlerNew
            IEnumerable <AbstractTemplateContextHandler> handlers =
                provider.GetHandlers();

            foreach (AbstractTemplateContextHandler currentHandler in handlers)
            {
                foreach (AbstractTemplateContextHandler secondCurrentHandler in handlers)
                {
                    if (secondCurrentHandler.GetType().Equals(currentHandler.GetType()))
                    {
                        continue;
                    }
                    if (secondCurrentHandler.StartContext.Contains(currentHandler.StartContext))
                    {
                        TestContext.Write("'" + currentHandler.GetType().Name + "' handler start context word :'" + secondCurrentHandler.StartContext + "' contains '" + currentHandler.GetType().Name + "' context handler start context word '" + currentHandler.StartContext + "'");
                        Assert.Fail();
                        return;
                    }
                }
            }
            Assert.IsTrue(true);
        }
コード例 #3
0
 public IList <ITemplateContextHandlerIdentity> GetAllItemplateContextHandlerIdentity()
 {
     return(templateContextHandlerProvider.GetHandlers().Cast <ITemplateContextHandlerIdentity>().ToList());
 }