diff options
author | Néstor Salceda <nestor@mono-cvs.ximian.com> | 2008-04-26 18:07:16 +0400 |
---|---|---|
committer | Néstor Salceda <nestor@mono-cvs.ximian.com> | 2008-04-26 18:07:16 +0400 |
commit | a1dbfdac557aa8e84f1aa12c76a60d51d9a627cd (patch) | |
tree | aff716cf56df93f221e04ebce157763b9776e5b8 /gendarme/rules/Gendarme.Rules.Smells/Test | |
parent | c45d17ea0a35ed0f0782243d7d8067643d24aa7f (diff) |
2008-04-26 Nestor Salceda <nestor.salceda@gmail.com>
* AvoidMessageChainsTest.cs: Added tests for check chains in the
arguments.
svn path=/trunk/mono-tools/; revision=101913
Diffstat (limited to 'gendarme/rules/Gendarme.Rules.Smells/Test')
-rw-r--r-- | gendarme/rules/Gendarme.Rules.Smells/Test/AvoidMessageChainsTest.cs | 13 | ||||
-rw-r--r-- | gendarme/rules/Gendarme.Rules.Smells/Test/ChangeLog | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidMessageChainsTest.cs b/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidMessageChainsTest.cs index 5993cb7c..cd3bfadf 100644 --- a/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidMessageChainsTest.cs +++ b/gendarme/rules/Gendarme.Rules.Smells/Test/AvoidMessageChainsTest.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; +using System.Text; using Gendarme.Framework; using Gendarme.Rules.Smells; @@ -48,10 +49,16 @@ namespace Test.Rules.Smells { Console.WriteLine ("I love rock and roll"); } + public void MethodWithArgumentsWithoutChain (Encoding encoding) + { + encoding.GetEncoder (); + } + [Test] public void MethodWithoutChainTest () { AssertRuleSuccess<AvoidMessageChainsTest> ("MethodWithoutChain"); + AssertRuleSuccess<AvoidMessageChainsTest> ("MethodWithArgumentsWithoutChain"); } public void MethodWithChain () @@ -68,11 +75,17 @@ namespace Test.Rules.Smells { int minor = Assembly.GetExecutingAssembly ().GetName ().Version.Minor; } + public void MethodWithArgumentsChained (Encoding encoding) + { + encoding.GetEncoder ().Fallback.CreateFallbackBuffer ().GetNextChar (); + } + [Test] public void MethodWithChainTest () { AssertRuleFailure<AvoidMessageChainsTest> ("MethodWithChain", 1); AssertRuleFailure<AvoidMessageChainsTest> ("MethodWithVariousChains", 2); + AssertRuleFailure<AvoidMessageChainsTest> ("MethodWithArgumentsChained", 1); } [Test] diff --git a/gendarme/rules/Gendarme.Rules.Smells/Test/ChangeLog b/gendarme/rules/Gendarme.Rules.Smells/Test/ChangeLog index e6fef5b6..84fe3baf 100644 --- a/gendarme/rules/Gendarme.Rules.Smells/Test/ChangeLog +++ b/gendarme/rules/Gendarme.Rules.Smells/Test/ChangeLog @@ -1,3 +1,8 @@ +2008-04-26 Nestor Salceda <nestor.salceda@gmail.com> + + * AvoidMessageChainsTest.cs: Added tests for check chains in the + arguments. + 2008-02-07 Nestor Salceda <nestor.salceda@gmail.com> * AvoidLargeClassesTest.cs: Added a test for class storing common |