-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resurrected older Surround With functionality in order to work around…
… code templates timeout issue.
- Loading branch information
1 parent
d1d124b
commit 863969e
Showing
21 changed files
with
543 additions
and
391 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
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,45 @@ | ||
using DPackRx.Features.SurroundWith; | ||
|
||
using NUnit.Framework; | ||
|
||
namespace DPackRx.Tests.Features | ||
{ | ||
/// <summary> | ||
/// SurroundWithModel tests. | ||
/// </summary> | ||
[TestFixture] | ||
public class SurroundWithModelTests | ||
{ | ||
#region Tests | ||
|
||
[Test] | ||
public void SurroundWithModel() | ||
{ | ||
var model = new SurroundWithModel(); | ||
|
||
Assert.That(model.Models, Is.Not.Null); | ||
Assert.That(model.Models.Count, Is.Zero); | ||
} | ||
|
||
[Test] | ||
public void SurroundWithLanguageModel() | ||
{ | ||
var model = new SurroundWithLanguageModel | ||
{ | ||
Language = SurroundWithLanguage.CSharp, | ||
Type = SurroundWithType.ForEach, | ||
StartingCode = "test1", | ||
EndingCode = "test2", | ||
WordOffset = 123 | ||
}; | ||
|
||
Assert.That(model.Language, Is.EqualTo(SurroundWithLanguage.CSharp)); | ||
Assert.That(model.Type, Is.EqualTo(SurroundWithType.ForEach)); | ||
Assert.That(model.StartingCode, Is.EqualTo("test1")); | ||
Assert.That(model.EndingCode, Is.EqualTo("test2")); | ||
Assert.That(model.WordOffset, Is.EqualTo(123)); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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,73 @@ | ||
using System.Collections.Generic; | ||
|
||
using DPackRx.Language; | ||
using DPackRx.Package; | ||
|
||
using NUnit.Framework; | ||
|
||
namespace DPackRx.Tests.Language | ||
{ | ||
/// <summary> | ||
/// LanguageSettings tests. | ||
/// </summary> | ||
[TestFixture] | ||
public class LanguageSettingsTests | ||
{ | ||
#region Tests | ||
|
||
[TestCase(LanguageConsts.VS_CM_LANGUAGE_CSHARP, LanguageType.CSharp)] | ||
[TestCase(LanguageConsts.VS_CM_LANGUAGE_VB, LanguageType.VB)] | ||
[TestCase(LanguageConsts.VS_CM_LANGUAGE_VC, LanguageType.CPP)] | ||
[TestCase(LanguageConsts.VS_LANGUAGE_JAVA_SCRIPT, LanguageType.JavaScript)] | ||
[TestCase(LanguageConsts.VS_LANGUAGE_XML, LanguageType.Xml)] | ||
[TestCase(LanguageConsts.VS_LANGUAGE_SOLUTION_ITEMS, LanguageType.SolutionItems)] | ||
[TestCase(LanguageConsts.VS_LANGUAGE_SQL, LanguageType.Sql)] | ||
[TestCase("bad", LanguageType.Unknown)] | ||
public void GetLanguage(string projectLanguage, LanguageType languageType) | ||
{ | ||
var language = new LanguageSettings(projectLanguage, "Test") | ||
{ | ||
CheckDuplicateNames = true, | ||
Comments = new Dictionary<string, bool> { { "test", true } }, | ||
DesignerFiles = LanguageDesignerFiles.FullySupported, | ||
Extensions = new Dictionary<string, bool> { { ".txt", true } }, | ||
IgnoreCodeType = true, | ||
Imports = LanguageImports.Supported, | ||
ParentlessFullName = true, | ||
ProjectGuid = "test", | ||
SmartFormat = true, | ||
SupportsCompileBuildAction = true, | ||
SupportsGenerics = true, | ||
SupportsStatistics = true, | ||
SurroundWith = true, | ||
WebLanguage = "test", | ||
WebNames = new string[] { "test" }, | ||
XmlDocs = new string[] { "test" }, | ||
XmlDocSurround = true, | ||
}; | ||
|
||
Assert.That(language.Language, Is.EqualTo(projectLanguage)); | ||
Assert.That(language.FriendlyName, Is.EqualTo("Test")); | ||
Assert.That(language.Type, Is.EqualTo(languageType)); | ||
Assert.That(language.CheckDuplicateNames, Is.True); | ||
Assert.That(language.Comments, Is.Not.Null.And.Count.EqualTo(1)); | ||
Assert.That(language.DesignerFiles, Is.EqualTo(LanguageDesignerFiles.FullySupported)); | ||
Assert.That(language.Extensions, Is.Not.Null.And.Count.EqualTo(1)); | ||
Assert.That(language.IgnoreCodeType, Is.True); | ||
Assert.That(language.Imports, Is.EqualTo(LanguageImports.Supported)); | ||
Assert.That(language.ParentlessFullName, Is.True); | ||
Assert.That(language.ProjectGuid, Is.EqualTo("test")); | ||
Assert.That(language.SmartFormat, Is.True); | ||
Assert.That(language.SupportsCompileBuildAction, Is.True); | ||
Assert.That(language.SupportsGenerics, Is.True); | ||
Assert.That(language.SupportsStatistics, Is.True); | ||
Assert.That(language.SurroundWith, Is.True); | ||
Assert.That(language.WebLanguage, Is.EqualTo("test")); | ||
Assert.That(language.WebNames, Is.Not.Null.And.Length.EqualTo(1)); | ||
Assert.That(language.XmlDocs, Is.Not.Null.And.Length.EqualTo(1)); | ||
Assert.That(language.XmlDocSurround, Is.True); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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.