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)); }
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()); }
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)); }