diff options
author | Néstor Salceda <nestor@mono-cvs.ximian.com> | 2008-04-18 14:37:14 +0400 |
---|---|---|
committer | Néstor Salceda <nestor@mono-cvs.ximian.com> | 2008-04-18 14:37:14 +0400 |
commit | e79e8dbea788832d5eedd8d95f72cf0a9096e5f5 (patch) | |
tree | e9e4fced5642d390c12c536293bf6a63eb91fc93 /gendarme/rules/Gendarme.Rules.Smells/Test | |
parent | d403ca1555293d1537b5bfe33b50bf740eed2859 (diff) |
2008-04-28 Nestor Salceda <nestor.salceda@gmail.com>
* AvoidLongParameterListsRule.cs: Implemented delegate checking.
* Test/AvoidLongParameterListsRule.cs: Added tests for delegate special
checking.
svn path=/trunk/mono-tools/; revision=101110
Diffstat (limited to 'gendarme/rules/Gendarme.Rules.Smells/Test')
-rw-r--r-- | gendarme/rules/Gendarme.Rules.Smells/Test/AvoidLongParameterListsTest.cs | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidLongParameterListsTest.cs b/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidLongParameterListsTest.cs index f9b54a3e..022e4309 100644 --- a/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidLongParameterListsTest.cs +++ b/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidLongParameterListsTest.cs @@ -119,24 +119,44 @@ namespace Test.Rules.Smells { AssertRuleFailure<VariousViolationsMethodWrapper> (2); } - class ShortConstructor { - public ShortConstructor (int x, float f, char c) {} + class ShortConstructorWrapper { + public ShortConstructorWrapper (int x, float f, char c) {} } [Test] - public void ShortConstructorTest () + public void ShortConstructorWrapperTest () { - AssertRuleSuccess<ShortConstructor> (); + AssertRuleSuccess<ShortConstructorWrapper> (); } - class LongConstructor { - public LongConstructor (int x, float f, char c, string str, object obj, double d, short s, object[] array) {} + class LongConstructorWrapper { + public LongConstructorWrapper (int x, float f, char c, string str, object obj, double d, short s, object[] array) {} } [Test] - public void LongConstructorTest () + public void LongConstructorWrapperTest () { - AssertRuleFailure<LongConstructor> (1); + AssertRuleFailure<LongConstructorWrapper> (1); + } + + class ShortDelegateWrapper { + public delegate void ShortDelegate (int x, char c); + } + + [Test] + public void ShortDelegateWrapperTest () + { + AssertRuleSuccess<ShortDelegateWrapper.ShortDelegate> (); + } + + class LongDelegateWrapper { + public delegate void LongDelegate (int x, float f, char c, string str, object obj, double d, short s, object[] array); + } + + [Test] + public void LongDelegateWrapperTest () + { + AssertRuleFailure<LongDelegateWrapper.LongDelegate> (1); } } } |