-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Andrew1Medvedev/update-theme
Add Theme name
- Loading branch information
Showing
13 changed files
with
771 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using NUnit.Framework; | ||
using TextMateSharp.Themes; | ||
|
||
namespace TextMateSharp.Grammars.Tests | ||
{ | ||
public class ThemeTests | ||
{ | ||
[Test] | ||
public void Assert_Every_Theme_Can_Be_Parsed() | ||
{ | ||
RegistryOptions options = new RegistryOptions(ThemeName.Light); | ||
|
||
foreach (var themeName in Enum.GetValues<ThemeName>()) | ||
{ | ||
try | ||
{ | ||
IRawTheme theme = options.LoadTheme(themeName); | ||
Assert.That(theme.GetTokenColors(), Has.Count, "Failed: " + themeName); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Assert.Fail( | ||
string.Format("[{0} theme]: {1}", themeName, ex.Message)); | ||
} | ||
} | ||
} | ||
|
||
[Test] | ||
public void Theme_Match_Should_Add_Rule_Names() | ||
{ | ||
RegistryOptions options = new RegistryOptions(ThemeName.DarkPlus); | ||
|
||
Registry.Registry registry = new Registry.Registry(options); | ||
|
||
Theme theme = registry.GetTheme(); | ||
|
||
var rule = theme.Match(new List<string>() { "source.cs", "keyword.other.using.cs" }); | ||
|
||
Assert.That(rule.Count, Is.GreaterThan(0)); | ||
Assert.That(rule[0].name, Is.Not.Null.Or.Empty); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.