ricardoboss / Prolangle

A game about programming languages.
https://prolangle.ricardoboss.de
MIT License
2 stars 1 forks source link

ApplicationsMatch seems to handle both sides being `None` wrong #93

Closed chucker closed 8 months ago

chucker commented 8 months ago

What happened?

If both languages have KnownForBuilding = .None, then overlap is also .None, but as a result, Match returns MatchType.None, when it should probably be MatchType.Exact.

As a result, the below test will fail.

What browsers are you seeing the problem on?

No response

Relevant log output

[Theory]
    [InlineData("SQL", "SQL",  MatchType.Exact)]
    public void TestApplicationsMatch(string thisLanguageName, string thatLanguageName, MatchType expectedMatchType)
    {
        ILanguage thisLanguage = LanguagesProvider.Languages.Single(l => l.Name == thisLanguageName);
        ILanguage thatLanguage = LanguagesProvider.Languages.Single(l => l.Name == thatLanguageName);

        MatchType matchType = new MetadatumComparisonService(thisLanguage).ApplicationsMatch(thatLanguage);

        Assert.Equal(expectedMatchType, matchType);
    }

Screenshots

No response