public void TypeMismatch_ReportsCorrectly() { ITemplateInfo templateInfo = new MockTemplateInfo(); ITemplateMatchInfo templateMatchInfo = new TemplateMatchInfo(templateInfo); templateMatchInfo.AddMatchDisposition(new MatchInfo(MatchInfo.BuiltIn.Type, "test", MatchKind.Mismatch)); Assert.False(WellKnownSearchFilters.MatchesAllCriteria(templateMatchInfo)); Assert.False(WellKnownSearchFilters.MatchesAtLeastOneCriteria(templateMatchInfo)); Assert.False(templateMatchInfo.IsInvokableMatch()); Assert.False(templateMatchInfo.HasAmbiguousParameterValueMatch()); }
public void EmptyMatchDisposition_ReportsCorrectly() { ITemplateInfo templateInfo = new MockTemplateInfo(); ITemplateMatchInfo templateMatchInfo = new TemplateMatchInfo(templateInfo); Assert.False(WellKnownSearchFilters.MatchesAllCriteria(templateMatchInfo)); Assert.False(WellKnownSearchFilters.MatchesAtLeastOneCriteria(templateMatchInfo)); Assert.False(templateMatchInfo.IsInvokableMatch()); Assert.False(templateMatchInfo.HasAmbiguousParameterValueMatch()); Assert.Empty(templateMatchInfo.GetInvalidParameterNames()); Assert.Equal(0, templateMatchInfo.GetValidTemplateParameters().Count); }
public void EmptyMatchDisposition_ReportsCorrectly() { ITemplateInfo templateInfo = new TemplateInfo(); ITemplateMatchInfo TemplateMatchInfo = new TemplateMatchInfo(templateInfo); Assert.False(TemplateMatchInfo.IsMatch); Assert.False(TemplateMatchInfo.IsMatchExceptContext()); Assert.False(TemplateMatchInfo.IsPartialMatch); Assert.False(TemplateMatchInfo.IsPartialMatchExceptContext()); Assert.False(TemplateMatchInfo.IsInvokableMatch()); Assert.False(TemplateMatchInfo.HasAmbiguousParameterValueMatch()); Assert.False(TemplateMatchInfo.HasParameterMismatch()); Assert.False(TemplateMatchInfo.HasParseError()); Assert.Equal(0, TemplateMatchInfo.GetInvalidParameterNames().Count); Assert.Equal(0, TemplateMatchInfo.GetValidTemplateParameters().Count); }
public void ContextMatch_ReportsCorrectly() { ITemplateInfo templateInfo = new TemplateInfo(); ITemplateMatchInfo TemplateMatchInfo = new TemplateMatchInfo(templateInfo); TemplateMatchInfo.AddDisposition(new MatchInfo { Location = MatchLocation.Context, Kind = MatchKind.Exact }); Assert.True(TemplateMatchInfo.IsMatch); Assert.False(TemplateMatchInfo.IsMatchExceptContext()); Assert.True(TemplateMatchInfo.IsPartialMatch); Assert.False(TemplateMatchInfo.IsPartialMatchExceptContext()); Assert.True(TemplateMatchInfo.IsInvokableMatch()); Assert.False(TemplateMatchInfo.HasAmbiguousParameterValueMatch()); Assert.False(TemplateMatchInfo.HasParameterMismatch()); Assert.False(TemplateMatchInfo.HasParseError()); }