forked from codecadwallader/codemaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommentFormatHelper.cs
More file actions
36 lines (33 loc) · 1.11 KB
/
CommentFormatHelper.cs
File metadata and controls
36 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SteveCadwallader.CodeMaid.Model.Comments;
using SteveCadwallader.CodeMaid.Model.Comments.Options;
using System;
namespace SteveCadwallader.CodeMaid.UnitTests.Formatting
{
internal class CommentFormatHelper
{
public static string AssertEqualAfterFormat(
string text,
Action<FormatterOptions> options = null)
{
return AssertEqualAfterFormat(text, null, null, options);
}
public static string AssertEqualAfterFormat(
string text,
string expected,
Action<FormatterOptions> options = null)
{
return AssertEqualAfterFormat(text, expected, null, options);
}
public static string AssertEqualAfterFormat(
string text,
string expected,
string prefix,
Action<FormatterOptions> options = null)
{
var result = CodeComment.Format(text, prefix, options);
Assert.AreEqual(expected ?? text, result);
return result;
}
}
}