Skip to content

Commit d45f14f

Browse files
committed
Refaktoring tests, removed initializers
1 parent 589869d commit d45f14f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/CommandLine.Tests/Unit/BaseAttributeTests.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ public static void Default(object defaultValue)
2424
[InlineData("HelpText", typeof(Fakes.NonStaticResource), "Localized HelpText")]
2525
public static void HelpText(string helpText, Type resourceType, string expected)
2626
{
27-
TestBaseAttribute baseAttribute = new TestBaseAttribute()
28-
{
29-
HelpText = helpText,
30-
ResourceType = resourceType
31-
};
27+
TestBaseAttribute baseAttribute = new TestBaseAttribute();
28+
baseAttribute.HelpText = helpText;
29+
baseAttribute.ResourceType = resourceType;
30+
3231
Assert.Equal(expected, baseAttribute.HelpText);
3332
}
3433

@@ -39,11 +38,9 @@ public static void HelpText(string helpText, Type resourceType, string expected)
3938
[InlineData("HelpText", typeof(Fakes.InternalResource))]
4039
public void ThrowsHelpText(string helpText, Type resourceType)
4140
{
42-
TestBaseAttribute baseAttribute = new TestBaseAttribute()
43-
{
44-
HelpText = helpText,
45-
ResourceType = resourceType
46-
};
41+
TestBaseAttribute baseAttribute = new TestBaseAttribute();
42+
baseAttribute.HelpText = helpText;
43+
baseAttribute.ResourceType = resourceType;
4744

4845
// Verify exception
4946
Assert.Throws<ArgumentException>(() => baseAttribute.HelpText.ToString());

0 commit comments

Comments
 (0)