Assert.That(fixedName.ToSuggestedFileName("Backend"),Is.EqualTo(expectedFileName),"The tool finds no file under another name, whatever the heading above the block says.");
Assert.That(SourceCodeLanguages.FromCodeFenceLanguage("powershell").ToFileEncoding().GetPreamble(),Is.Not.Empty,"Windows PowerShell 5.1 reads a script without one in the ANSI code page.");
Assert.That(SourceCodeLanguages.FromCodeFenceLanguage("python").ToFileEncoding().GetPreamble(),Is.Empty,"An interpreter has no use for it, and a shebang line breaks behind one.");
Assert.That(SourceCodeLanguages.Languages.Where(language=>language.NeedsWindowsLineEndings).Select(language=>language.Name),Is.EqualTo(new[]{"Batch"}),"The command prompt misses jump labels in a file whose lines end with LF alone.");
Assert.That(language.FileExtension.Lengthis0^language.FileName.Lengthis0,Is.True,$"{language.Name} needs either an extension or a fixed file name, not both.");
if(language.FileExtension.Length>0)
Assert.That(language.FileExtension,Does.StartWith(".").And.Length.GreaterThan(1),$"{language.Name} has a broken extension.");
Assert.That(SourceCodeLanguages.Aliases,Is.Unique.Using((IEqualityComparer<string>)StringComparer.OrdinalIgnoreCase),"Plain text is checked first, so a language with the same alias would never be found.");
}
[Test]
publicvoidNoAliasNamesAFormatOfItsOwn()
{
// FileExportFormatExtensions.TryFromCodeFenceLanguage is asked first, so such an entry would never be found: