main
1using System.Collections;
2using developwithpassion.bdd.contexts;
3using Gorilla.Commons.Testing;
4
5namespace momoney.database.transactions
6{
7 public class PerThreadScopedStorageSpecs
8 {
9 [Concern(typeof (PerThreadScopedStorage))]
10 public class when_retrieving_the_storage_for_a_specific_thread :
11 concerns_for<IScopedStorage, PerThreadScopedStorage>
12 {
13 context c = () =>
14 {
15 thread = the_dependency<IThread>();
16 storage = new Hashtable();
17 when_the(thread)
18 .is_told_to(x => x.provide_slot_for<Hashtable>())
19 .it_will_return(storage);
20 };
21
22 because b = () =>
23 {
24 result = sut.provide_storage();
25 };
26
27 it should_return_the_storage_the_corresponds_to_the_current_thread = () => result.should_be_equal_to(storage);
28
29 static IDictionary result;
30 static IThread thread;
31 static Hashtable storage;
32 }
33 }
34}