Пример #1
0
        public void TypeMatch_NameMismatch_ReportsCorrectly()
        {
            ITemplateInfo      templateInfo      = new MockTemplateInfo();
            ITemplateMatchInfo templateMatchInfo = new TemplateMatchInfo(templateInfo);

            templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Name, "test", MatchKind.Mismatch));
            templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Type, "test", MatchKind.Exact));
            Assert.False(WellKnownSearchFilters.MatchesAllCriteria(templateMatchInfo));
            Assert.True(WellKnownSearchFilters.MatchesAtLeastOneCriteria(templateMatchInfo));
        }
Пример #2
0
        public void TypeMismatch_NamePartialMatch_ReportsCorrectly()
        {
            ITemplateInfo      templateInfo      = new MockTemplateInfo();
            ITemplateMatchInfo templateMatchInfo = new TemplateMatchInfo(templateInfo);

            templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Name, "test", MatchKind.Partial));
            templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Type, "test", MatchKind.Mismatch));
            Assert.False(WellKnownSearchFilters.MatchesAllCriteria(templateMatchInfo));
            Assert.True(WellKnownSearchFilters.MatchesAtLeastOneCriteria(templateMatchInfo));
            Assert.False(templateMatchInfo.IsInvokableMatch());
            Assert.False(templateMatchInfo.HasAmbiguousParameterValueMatch());
        }
Пример #3
0
        public void NamePartialMatch_ReportsCorrectly()
        {
            ITemplateInfo      templateInfo      = new MockTemplateInfo();
            ITemplateMatchInfo templateMatchInfo = new TemplateMatchInfo(templateInfo);

            templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Name, "test", MatchKind.Partial));
            Assert.True(WellKnownSearchFilters.MatchesAllCriteria(templateMatchInfo));
            Assert.True(WellKnownSearchFilters.MatchesAtLeastOneCriteria(templateMatchInfo));
        }