[tinybdd] r58 committed - Changed specification

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 7, 2009, 9:51:56 AM10/7/09
to tin...@googlegroups.com
Revision: 58
Author: goeran.hansen
Date: Wed Oct 7 06:51:05 2009
Log: Changed specification

http://code.google.com/p/tinybdd/source/detail?r=58

Modified:
/trunk/TinyBDD.Specification.NUnit/SpecificationExtensions.cs

=======================================
--- /trunk/TinyBDD.Specification.NUnit/SpecificationExtensions.cs Sat Jun
13 15:33:02 2009
+++ /trunk/TinyBDD.Specification.NUnit/SpecificationExtensions.cs Wed Oct
7 06:51:05 2009
@@ -89,13 +89,14 @@
Assert.IsTrue(str.Contains(expectedStr), string.Format("string
\"{0}\" should contained \"{1}\"", str, expectedStr));
}

- public static void ShouldContain(this IList list, object
expectedObject)
- {
- var index = list.IndexOf(expectedObject);
- if (index == -1)
- {
- Assert.Fail("Expected object was not in list");
- }
+ public static void ShouldContain(this IEnumerable list, object
expectedObject)
+ {
+ foreach (var item in list)
+ {
+ if (item == expectedObject)
+ return;
+ }
+ Assert.Fail("Expected object was not in list");
}

public static void ShouldHave(this IList list, int expectedCount)

Reply all
Reply to author
Forward
0 new messages