-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
154 changed files
with
9,044 additions
and
2,012 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
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
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
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,71 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using SteveCadwallader.CodeMaid.Properties; | ||
using System; | ||
|
||
namespace SteveCadwallader.CodeMaid.UnitTests.Formatting | ||
{ | ||
/// <summary> | ||
/// Test for the ignoring of comments lines starting with certain prefixes. | ||
/// </summary> | ||
[TestClass] | ||
public class IgnorePrefixesTests | ||
{ | ||
[TestInitialize] | ||
public void TestInitialize() | ||
{ | ||
Settings.Default.Reset(); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory("Formatting UnitTests")] | ||
public void IgnorePrefixesTests_DoesNotWrapSingleLine() | ||
{ | ||
Settings.Default.Formatting_CommentWrapColumn = 30; | ||
CommentFormatHelper.AssertEqualAfterFormat(@"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit."); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory("Formatting UnitTests")] | ||
public void IgnorePrefixesTests_DoesNotWrapLineInsideComment() | ||
{ | ||
var input = | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."; | ||
|
||
// Expect all lines to be wrapped except for the one starting with "TODO". | ||
var expected = | ||
"Lorem ipsum dolor sit amet," + Environment.NewLine + | ||
"consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"Lorem ipsum dolor sit amet," + Environment.NewLine + | ||
"consectetur adipiscing elit."; | ||
|
||
Settings.Default.Formatting_CommentWrapColumn = 30; | ||
CommentFormatHelper.AssertEqualAfterFormat(input, expected); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory("Formatting UnitTests")] | ||
public void IgnorePrefixesTests_DoesNotCombineSubsequentLines() | ||
{ | ||
var input = | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."; | ||
|
||
// Expect every "ignored" line to stay on it's own. | ||
var expected = | ||
"Lorem ipsum dolor sit amet," + Environment.NewLine + | ||
"consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + | ||
"Lorem ipsum dolor sit amet," + Environment.NewLine + | ||
"consectetur adipiscing elit."; | ||
|
||
Settings.Default.Formatting_CommentWrapColumn = 30; | ||
CommentFormatHelper.AssertEqualAfterFormat(input, expected); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -95,4 +95,4 @@ private static CodeItemMethod CreateExplicitMethod(string interfaceName, string | |
return method; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.