diff --git a/gendarme/rules/Gendarme.Rules.Naming/Test/UseCorrectSuffixTest.cs b/gendarme/rules/Gendarme.Rules.Naming/Test/UseCorrectSuffixTest.cs index adb15fa2c..458302f0b 100644 --- a/gendarme/rules/Gendarme.Rules.Naming/Test/UseCorrectSuffixTest.cs +++ b/gendarme/rules/Gendarme.Rules.Naming/Test/UseCorrectSuffixTest.cs @@ -246,6 +246,15 @@ public class DictionaryIncorrect : Dictionary { public class DictionaryIncorrectDerived : DictionaryIncorrect { } + public class CorrectCollectionAndDictionary : Dictionary, ICollection { + public void Add(V item) { throw new NotImplementedException(); } + public bool Contains(V item) { throw new NotImplementedException(); } + public void CopyTo(V[] array, int arrayIndex) { throw new NotImplementedException(); } + public bool IsReadOnly { get { throw new NotImplementedException(); } } + public bool Remove(V item) { throw new NotImplementedException(); } + public new IEnumerator GetEnumerator() { throw new NotImplementedException(); } + } + [TestFixture] public class UseCorrectSuffixTest : TypeRuleTestFixture { @@ -305,7 +314,7 @@ public void TestInterfaceImplementerCorrectName () AssertRuleSuccess (); } - [Test] + [Test] public void TestInterfaceImplementerIncorrectName () { AssertRuleFailureWithLowConfidence (); @@ -323,7 +332,7 @@ public void TestMultipleInterfaceImplementerAnotherCorrectName () AssertRuleSuccess (); } - [Test] + [Test] public void TestMultipleInterfaceImplementerIncorrectName () { AssertRuleFailureWithHighConfidence (); @@ -376,6 +385,8 @@ public void GenericCollection () public void GenericDictionary () { AssertRuleSuccess> (); + //bug: to be consistent with FxCop, a class implementing IDictionary and ICollection should end in Dictionary + AssertRuleSuccess>(); AssertRuleFailureWithHighConfidence> (); }