Commit 682db4c

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-04-04 16:20:56
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@135 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent 9ce736d
trunk/product/MyMoney/boot/container/registration/auto_wire_components_in_to_the.cs
@@ -2,14 +2,17 @@ using System;
 using System.Reflection;
 using MoMoney.Infrastructure.Container;
 using MoMoney.Infrastructure.Container.Windsor.configuration;
-using MoMoney.Infrastructure.Extensions;
 using MoMoney.Infrastructure.reflection;
 using MoMoney.Utility.Core;
 using MoMoney.Utility.Extensions;
 
 namespace MoMoney.boot.container.registration
 {
-    public class auto_wire_components_in_to_the : ICommand, IParameterizedCommand<IAssembly>
+    public interface IStartupCommand : ICommand, IParameterizedCommand<IAssembly>
+    {
+    }
+
+    public class auto_wire_components_in_to_the : IStartupCommand
     {
         readonly IDependencyRegistration registrar;
         readonly IComponentExclusionSpecification exclusion_policy;
@@ -36,15 +39,8 @@ namespace MoMoney.boot.container.registration
 
         void add_registration_for(Type type)
         {
-            if (type.GetInterfaces().Length > 0)
-            {
-                registrar.transient(type.first_interface(), type);
-            }
-            else
-            {
-                registrar.transient(type, type);
-            }
-            //this.log().debug("registered: {0}", type);
+            if (type.GetInterfaces().Length > 0) registrar.transient(type.first_interface(), type);
+            else registrar.transient(type, type);
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/auto_wire_components_in_to_the_specs.cs
@@ -6,13 +6,12 @@ using MoMoney.Infrastructure.Container.Windsor.configuration;
 using MoMoney.Infrastructure.reflection;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
-using MoMoney.Utility.Core;
 
 namespace MoMoney.boot.container.registration
 {
-    [Ignore]
+    [Ignore("I am not sure why but line 19 throws a BadImageFormatException")]
     public class behaves_like_auto_registering_components_into_container :
-        concerns_for<IParameterizedCommand<IAssembly>, auto_wire_components_in_to_the>
+        concerns_for<IStartupCommand, auto_wire_components_in_to_the>
     {
         context c = () =>
                         {
trunk/product/MyMoney/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -29,11 +29,12 @@ namespace MoMoney.boot.container.registration
             registration.singleton(
                 () =>
                     {
-                        if (SynchronizationContext.Current == null)
-                        {
-                            SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext());
-                        }
-                        return SynchronizationContext.Current;
+                        return AsyncOperationManager.SynchronizationContext;
+                        //if (SynchronizationContext.Current == null)
+                        //{
+                        //    SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext());
+                        //}
+                        //return SynchronizationContext.Current;
                     });
             registration.singleton<AsyncOperation>(() => AsyncOperationManager.CreateOperation(null));
             registration.singleton<ApplicationDeployment>(() => ApplicationDeployment.IsNetworkDeployed ? ApplicationDeployment.CurrentDeployment : null);
trunk/product/MyMoney/Domain/accounting/GeneralLedgerSpecs.cs
@@ -6,7 +6,6 @@ using MoMoney.Domain.Core;
 using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
-using mocking_extensions=MoMoney.Testing.spechelpers.core.mocking_extensions;
 
 namespace MoMoney.Domain.accounting
 {
trunk/product/MyMoney/Infrastructure/cloning/Serializer.cs
@@ -11,11 +11,11 @@ namespace MoMoney.Infrastructure.cloning
             this.formatter = formatter;
         }
 
-        public void serialize(T toSerialize)
+        public void serialize(T to_serialize)
         {
             using (var stream = new FileStream(file_path, FileMode.Create, FileAccess.Write))
             {
-                formatter.Serialize(stream, toSerialize);
+                formatter.Serialize(stream, to_serialize);
             }
         }
 
trunk/product/MyMoney/Infrastructure/interceptors/LazySpecs.cs
@@ -64,7 +64,7 @@ namespace MoMoney.Infrastructure.interceptors
     public class when_calling_different_methods_on_an_proxied_object : behaves_like_a_lazy_loaded_object
     {
         it should_only_load_the_object_once =
-            () => mocking_extensions.was_told_to(test_container, x => x.get_a<ITargetObject>()).only_once();
+            () => MockingExtensions.was_told_to(test_container, x => x.get_a<ITargetObject>()).only_once();
 
         context c = () =>
                         {
@@ -150,7 +150,7 @@ namespace MoMoney.Infrastructure.interceptors
     public class when_calling_a_generic_method_on_a_proxied_object : behaves_like_a_lazy_loaded_object
     {
         it should_forward_the_call_to_the_target =
-            () => mocking_extensions.was_told_to(target, x => x.ValueReturningMethodWithAnArgument("blah"));
+            () => MockingExtensions.was_told_to(target, x => x.ValueReturningMethodWithAnArgument("blah"));
 
         it should_return_the_correct_result = () => result.should_be_equal_to("hooray");
 
trunk/product/MyMoney/Infrastructure/transactions2/IChangeTracker.cs
@@ -0,0 +1,13 @@
+namespace MoMoney.Infrastructure.transactions2
+{
+    public interface IChangeTracker
+    {
+        bool is_dirty();
+        void commit_to(IDatabase database);
+    }
+
+    public interface IChangeTracker<T> : IChangeTracker
+    {
+        void register(T value);
+    }
+}
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/transactions2/IChangeTrackerFactory.cs
@@ -0,0 +1,7 @@
+namespace MoMoney.Infrastructure.transactions2
+{
+    public interface IChangeTrackerFactory
+    {
+        IChangeTracker<T> create_for<T>();
+    }
+}
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/transactions2/IdentityMapProxy.cs
@@ -0,0 +1,48 @@
+using System.Collections.Generic;
+using MoMoney.Domain.Core;
+
+namespace MoMoney.Infrastructure.transactions2
+{
+    public class IdentityMapProxy<Key, Value> : IIdentityMap<Key, Value> where Value : IEntity
+    {
+        readonly IIdentityMap<Key, Value> real_map;
+        readonly IChangeTracker<Value> change_tracker;
+
+        public IdentityMapProxy(IChangeTracker<Value> change_tracker, IIdentityMap<Key, Value> real_map)
+        {
+            this.change_tracker = change_tracker;
+            this.real_map = real_map;
+        }
+
+        public IEnumerable<Value> all()
+        {
+            return real_map.all();
+        }
+
+        public void add(Key key, Value value)
+        {
+            change_tracker.register(value);
+            real_map.add(key, value);
+        }
+
+        public void update_the_item_for(Key key, Value new_value)
+        {
+            real_map.update_the_item_for(key, new_value);
+        }
+
+        public bool contains_an_item_for(Key key)
+        {
+            return real_map.contains_an_item_for(key);
+        }
+
+        public Value item_that_belongs_to(Key key)
+        {
+            return real_map.item_that_belongs_to(key);
+        }
+
+        public void remove(Key key)
+        {
+            real_map.remove(key);
+        }
+    }
+}
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/transactions2/IStatementRegistry.cs
@@ -4,5 +4,6 @@ namespace MoMoney.Infrastructure.transactions2
     {
         IStatement prepare_insert_statement_for<T>(T entity);
         IStatement prepare_update_statement_for<T>(T entity);
+        IStatement prepare_delete_statement_for<T>(T entity);
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/transactions2/Session.cs
@@ -79,14 +79,14 @@ namespace MoMoney.Infrastructure.transactions2
             if (null != transaction) transaction.rollback_changes();
         }
 
-        IIdentityMap<Guid, T> get_identity_map_for<T>()
+        IIdentityMap<Guid, T> get_identity_map_for<T>() where T : IEntity
         {
             return identity_maps.ContainsKey(typeof (T))
                        ? identity_maps[typeof (T)].downcast_to<IIdentityMap<Guid, T>>()
                        : create_map_for<T>();
         }
 
-        IIdentityMap<Guid, T> create_map_for<T>()
+        IIdentityMap<Guid, T> create_map_for<T>() where T : IEntity
         {
             var identity_map = transaction.create_for<T>();
             identity_maps.Add(typeof (T), identity_map);
trunk/product/MyMoney/Infrastructure/transactions2/Transaction.cs
@@ -1,13 +1,15 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using MoMoney.Domain.Core;
+using MoMoney.Infrastructure.Extensions;
 using MoMoney.Utility.Extensions;
 
 namespace MoMoney.Infrastructure.transactions2
 {
     public interface ITransaction
     {
-        IIdentityMap<Guid, T> create_for<T>();
+        IIdentityMap<Guid, T> create_for<T>() where T : IEntity;
         void add_transient<T>(T entity) where T : IEntity;
         void add_dirty<T>(T modified) where T : IEntity;
         void mark_for_deletion<T>(T entity) where T : IEntity;
@@ -19,20 +21,26 @@ namespace MoMoney.Infrastructure.transactions2
     {
         readonly IStatementRegistry registry;
         readonly IDatabase database;
-        readonly ICollection<IEntity> transients;
-        readonly ICollection<IEntity> dirty;
+        readonly IChangeTrackerFactory factory;
+        readonly List<IEntity> transients;
+        readonly List<IEntity> dirty;
+        readonly List<IEntity> to_be_deleted;
+        IDictionary<Type, IChangeTracker> change_trackers;
 
-        public Transaction(IStatementRegistry registry, IDatabase database)
+        public Transaction(IStatementRegistry registry, IDatabase database, IChangeTrackerFactory factory)
         {
             this.registry = registry;
+            this.factory = factory;
             this.database = database;
-            transients = new HashSet<IEntity>();
-            dirty = new HashSet<IEntity>();
+            change_trackers = new Dictionary<Type, IChangeTracker>();
+            transients = new List<IEntity>();
+            dirty = new List<IEntity>();
+            to_be_deleted = new List<IEntity>();
         }
 
-        public IIdentityMap<Guid, T> create_for<T>()
+        public IIdentityMap<Guid, T> create_for<T>() where T : IEntity
         {
-            return new IdentityMap<Guid, T>();
+            return new IdentityMapProxy<Guid, T>(get_change_tracker_for<T>(), new IdentityMap<Guid, T>());
         }
 
         public void add_transient<T>(T entity) where T : IEntity
@@ -47,18 +55,34 @@ namespace MoMoney.Infrastructure.transactions2
 
         public void mark_for_deletion<T>(T entity) where T : IEntity
         {
-            throw new NotImplementedException();
+            to_be_deleted.Add(entity);
         }
 
         public void commit_changes()
         {
-            dirty.each(x => database.apply(registry.prepare_update_statement_for(x)));
+            change_trackers.Values
+                .where(x => x.is_dirty())
+                .each(x => x.commit_to(database));
+
             transients.each(x => database.apply(registry.prepare_insert_statement_for(x)));
+            dirty.each(x => database.apply(registry.prepare_update_statement_for(x)));
+            to_be_deleted.each(x => database.apply(registry.prepare_delete_statement_for(x)));
         }
 
         public void rollback_changes()
         {
             throw new NotImplementedException();
         }
+
+        IChangeTracker<T> get_change_tracker_for<T>() where T : IEntity
+        {
+            if (!change_trackers.ContainsKey(typeof(T)))
+            {
+                var tracker = factory.create_for<T>();
+                this.log().debug("tracker: {0}", tracker);
+                change_trackers.Add(typeof(T), tracker);
+            }
+            return change_trackers[typeof (T)].downcast_to<IChangeTracker<T>>();
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/transactions2/TransactionSpecs.cs
@@ -1,5 +1,7 @@
 using System;
 using developwithpassion.bdd.contexts;
+using MoMoney.Domain.Core;
+using MoMoney.Infrastructure.Logging;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
 
@@ -15,22 +17,24 @@ namespace MoMoney.Infrastructure.transactions2
                         {
                             registry = the_dependency<IStatementRegistry>();
                             database = the_dependency<IDatabase>();
+                            factory = the_dependency<IChangeTrackerFactory>();
                         };
 
         protected static IStatementRegistry registry;
         protected static IDatabase database;
+        protected static IChangeTrackerFactory factory;
     }
 
     public class when_creating_an_identity_map_for_a_specific_entity : behaves_like_transaction
     {
         it should_return_a_new_identity_map = () => result.should_not_be_null();
 
-        because b = () => { result = sut.create_for<ITestEntity>(); };
+        because b = () => { result = sut.create_for<IEntity>(); };
 
-        static IIdentityMap<Guid, ITestEntity> result;
+        static IIdentityMap<Guid, IEntity> result;
     }
 
-    public class when_commiting_a_set_of_transient_instances_to_The_database : behaves_like_transaction
+    public class when_commiting_a_set_of_transient_instances_to_the_database : behaves_like_transaction
     {
         it should_prepare_an_insert_command_for_each_transient_instance =
             () => registry.was_told_to(x => x.prepare_insert_statement_for(entity));
@@ -40,7 +44,7 @@ namespace MoMoney.Infrastructure.transactions2
 
         context c = () =>
                         {
-                            entity = an<ITestEntity>();
+                            entity = an<IEntity>();
                             insert_statement = an<IStatement>();
                             when_the(registry)
                                 .is_told_to(x => x.prepare_insert_statement_for(entity))
@@ -53,34 +57,115 @@ namespace MoMoney.Infrastructure.transactions2
                             sut.commit_changes();
                         };
 
-        static ITestEntity entity;
+        static IEntity entity;
         static IStatement insert_statement;
     }
 
     public class when_commiting_a_set_of_dirty_instances_to_The_database : behaves_like_transaction
     {
-        it should_prepare_an_insert_command_for_each_transient_instance =
-            () => registry.was_told_to(x => x.prepare_update_statement_for(entity));
+        it should_prepare_an_update_command_for_each_transient_instance =
+            () => registry.was_told_to(x => x.prepare_update_statement_for(entity)).only_once();
 
-        it should_apply_the_insert_statement_against_the_database_for_each_entity =
-            () => database.was_told_to(x => x.apply(update_statement));
+        it should_apply_the_update_statement_against_the_database_for_each_entity =
+            () => database.was_told_to(x => x.apply(update_statement)).only_once();
+
+        it should_not_throw_an_exception = () => exception_thrown_while_the_sut_performed_its_work.should_be_null();
+
+        context c =
+            () =>
+                {
+                    entity = an<IEntity>();
+                    update_statement = an<IStatement>();
+
+                    Log.For(entity).debug("context");
+                    when_the(registry).is_told_to(x => x.prepare_update_statement_for(entity)).it_will_return( update_statement).Repeat.Any();
+                };
+
+        because b =
+            () =>
+                {
+                    Log.For(entity).debug("because");
+                    sut.add_dirty(entity);
+                    sut.commit_changes();
+                };
+
+        static IEntity entity;
+        static IStatement update_statement;
+    }
+
+    public class when_committing_a_transaction_and_an_item_in_the_identity_map_has_changed : behaves_like_transaction
+    {
+        it should_commit_the_changes_to_that_item = () => tracker.was_told_to(x => x.commit_to(database));
 
         context c = () =>
                         {
-                            entity = an<ITestEntity>();
+                            movie = new Movie("Goldeneye");
                             update_statement = an<IStatement>();
+                            tracker = an<IChangeTracker<IMovie>>();
+
                             when_the(registry)
-                                .is_told_to(x => x.prepare_update_statement_for(entity))
+                                .is_told_to(x => x.prepare_update_statement_for(movie))
                                 .it_will_return(update_statement);
+                            when_the(factory).is_told_to(x => x.create_for<IMovie>()).it_will_return(tracker);
+                            when_the(tracker).is_told_to(x => x.is_dirty()).it_will_return(true);
                         };
 
+
         because b = () =>
                         {
-                            sut.add_dirty(entity);
+                            sut.create_for<IMovie>().add(movie.Id, movie);
+                            movie.change_name_to("Austin Powers");
                             sut.commit_changes();
                         };
 
-        static ITestEntity entity;
         static IStatement update_statement;
+        static IMovie movie;
+        static IChangeTracker<IMovie> tracker;
+    }
+
+    public class when_deleting_a_set_of_entities_from_the_database : behaves_like_transaction
+    {
+        it should_apply_a_deletion_statement_for_each_entity =
+            () => database.was_told_to(x => x.apply(deletion_statement));
+
+        context c = () =>
+                        {
+                            entity = an<IEntity>();
+                            deletion_statement = an<IStatement>();
+                            when_the(registry)
+                                .is_told_to(x => x.prepare_delete_statement_for(entity))
+                                .it_will_return(deletion_statement);
+                        };
+
+        after_the_sut_has_been_created after_sut = () => sut.mark_for_deletion(entity);
+
+        because b = () => sut.commit_changes();
+
+        static IEntity entity;
+        static IStatement deletion_statement;
+    }
+
+    public interface IMovie : IEntity
+    {
+        string name { get; }
+        void change_name_to(string name);
+    }
+
+    internal class Movie : IMovie
+    {
+        public Movie(string name)
+        {
+            Id = Guid.NewGuid();
+            this.name = name;
+        }
+
+        public string name { get; set; }
+
+        public void change_name_to(string new_name)
+        {
+            name = new_name;
+        }
+
+        public Guid Id { get; set; }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Databindings/binding_selector_specs.cs
@@ -4,7 +4,6 @@ using developwithpassion.bdd.contexts;
 using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
-using mocking_extensions=MoMoney.Testing.spechelpers.core.mocking_extensions;
 
 namespace MoMoney.Presentation.Databindings
 {
@@ -15,7 +14,7 @@ namespace MoMoney.Presentation.Databindings
             () => result.property.Name.should_be_equal_to("FirstName");
 
         it should_inspect_the_expression_for_the_property_information =
-            () => mocking_extensions.was_told_to(inspector, i => i.inspect(expression_to_parse));
+            () => MockingExtensions.was_told_to(inspector, i => i.inspect(expression_to_parse));
 
         context c = () =>
                         {
@@ -23,9 +22,9 @@ namespace MoMoney.Presentation.Databindings
                             factory = an<IPropertyInspectorFactory>();
                             inspector = an<IPropertyInspector<IAnInterface, string>>();
 
-                            mocking_extensions.it_will_return(mocking_extensions.is_told_to(factory, f => f.create<IAnInterface, string>()), inspector);
+                            MockingExtensions.it_will_return(MockingExtensions.is_told_to(factory, f => f.create<IAnInterface, string>()), inspector);
 
-                            mocking_extensions.it_will_return(mocking_extensions.is_told_to(inspector, i => i.inspect(null))
+                            MockingExtensions.it_will_return(MockingExtensions.is_told_to(inspector, i => i.inspect(null))
                                                     .IgnoreArguments(), typeof (IAnInterface).GetProperty("FirstName"));
                         };
 
trunk/product/MyMoney/Presentation/Databindings/ComboBoxDataBindingSpecs.cs
@@ -3,7 +3,6 @@ using developwithpassion.bdd.contexts;
 using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
-using mocking_extensions=MoMoney.Testing.spechelpers.core.mocking_extensions;
 
 namespace MoMoney.Presentation.Databindings
 {
@@ -23,7 +22,7 @@ namespace MoMoney.Presentation.Databindings
                             combo_box.Items.Add(baby_boy);
                             combo_box.Items.Add(baby_girl);
 
-                            mocking_extensions.it_will_return(mocking_extensions.is_asked_for(when_the(thing_to_bind_to), t => t.Child), baby_girl);
+                            MockingExtensions.it_will_return(MockingExtensions.is_asked_for(when_the(thing_to_bind_to), t => t.Child), baby_girl);
                         };
 
         because b = () => Create
trunk/product/MyMoney/Presentation/Databindings/TextBoxDataBindingSpecs.cs
@@ -3,7 +3,6 @@ using developwithpassion.bdd.contexts;
 using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
-using mocking_extensions=MoMoney.Testing.spechelpers.core.mocking_extensions;
 
 namespace MoMoney.Presentation.Databindings
 {
@@ -17,7 +16,7 @@ namespace MoMoney.Presentation.Databindings
                         {
                             thing_to_bind_to = an<IAnInterface>();
                             text_box = new TextBox();
-                            mocking_extensions.it_will_return(mocking_extensions.is_asked_for(thing_to_bind_to, t => t.FirstName), first_name);
+                            MockingExtensions.it_will_return(MockingExtensions.is_asked_for(thing_to_bind_to, t => t.FirstName), first_name);
                         };
 
         because b = () => Create
trunk/product/MyMoney/Testing/spechelpers/contexts/concerns.cs
@@ -1,5 +1,5 @@
 using developwithpassion.bdd.mbunit.standard.observations;
-using MoMoney.Testing.Extensions;
+using MoMoney.Testing.spechelpers.core;
 using Rhino.Mocks;
 
 namespace MoMoney.Testing.spechelpers.contexts
trunk/product/MyMoney/Testing/spechelpers/core/assertions.cs
@@ -20,6 +20,12 @@ namespace MoMoney.Testing.spechelpers.core
             Assert.IsTrue(ReferenceEquals(left, right));
         }
 
+        [AssertionMethod]
+        public static void should_be_null<T>(this T item)
+        {
+            Assert.IsNull(item);
+        }
+
         [AssertionMethod]
         public static void should_not_be_null<T>(this T item) where T : class
         {
trunk/product/MyMoney/Testing/spechelpers/core/IHideObjectMembers.cs
@@ -1,7 +1,7 @@
 using System;
 using System.ComponentModel;
 
-namespace MoMoney.Testing.Extensions
+namespace MoMoney.Testing.spechelpers.core
 {
     [EditorBrowsable(EditorBrowsableState.Never)]
     public interface IHideObjectMembers
trunk/product/MyMoney/Testing/spechelpers/core/method_call_occurance.cs → trunk/product/MyMoney/Testing/spechelpers/core/MethodCallOccurance.cs
@@ -1,14 +1,14 @@
 using System;
 using Rhino.Mocks;
 
-namespace MoMoney.Testing.Extensions
+namespace MoMoney.Testing.spechelpers.core
 {
-    public class method_call_occurance<T> : IHideObjectMembers
+    public class MethodCallOccurance<T> : IHideObjectMembers
     {
         readonly Action<T> action;
         readonly T mock;
 
-        public method_call_occurance(T mock, Action<T> action)
+        public MethodCallOccurance(T mock, Action<T> action)
         {
             this.action = action;
             this.mock = mock;
trunk/product/MyMoney/Testing/spechelpers/core/mocking_extensions.cs
@@ -1,17 +1,16 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using MoMoney.Testing.Extensions;
 using Rhino.Mocks;
 using Rhino.Mocks.Interfaces;
 
 namespace MoMoney.Testing.spechelpers.core
 {
-    public static class mocking_extensions
+    public static class MockingExtensions
     {
-        public static method_call_occurance<T> was_told_to<T>(this T mocked_item, Action<T> actionToPerform)
+        public static MethodCallOccurance<T> was_told_to<T>(this T mocked_item, Action<T> action_to_perform)
         {
-            return new method_call_occurance<T>(mocked_item, actionToPerform);
+            return new MethodCallOccurance<T>(mocked_item, action_to_perform);
         }
 
         public static void was_not_told_to<T>(this T mocked_item, Action<T> action_to_perform)
trunk/product/MyMoney/Utility/Extensions/mapping_extensions_specs.cs
@@ -3,7 +3,6 @@ using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
 using MoMoney.Testing.spechelpers.core;
 using MoMoney.Utility.Core;
-using mocking_extensions=MoMoney.Testing.spechelpers.core.mocking_extensions;
 
 namespace MoMoney.Utility.Extensions
 {
@@ -18,8 +17,8 @@ namespace MoMoney.Utility.Extensions
                             second_mapper = an<IMapper<string, int>>();
                             a = 1;
 
-                            mocking_extensions.it_will_return(mocking_extensions.is_told_to(when_the(first_mapper), x => x.map_from(a)), "1");
-                            mocking_extensions.it_will_return(mocking_extensions.is_told_to(when_the(second_mapper), x => x.map_from("1")), 1);
+                            MockingExtensions.it_will_return(MockingExtensions.is_told_to(when_the(first_mapper), x => x.map_from(a)), "1");
+                            MockingExtensions.it_will_return(MockingExtensions.is_told_to(when_the(second_mapper), x => x.map_from("1")), 1);
                         };
 
         because b = () => { result = first_mapper.then(second_mapper).map_from(a); };
trunk/product/MyMoney/MyMoney.csproj
@@ -211,6 +211,9 @@
     <Compile Include="Domain\Core\range_specs.cs" />
     <Compile Include="Domain\repositories\IBillRepository.cs" />
     <Compile Include="Domain\repositories\ICompanyRepository.cs" />
+    <Compile Include="Infrastructure\transactions2\IChangeTracker.cs" />
+    <Compile Include="Infrastructure\transactions2\IChangeTrackerFactory.cs" />
+    <Compile Include="Infrastructure\transactions2\IdentityMapProxy.cs" />
     <Compile Include="Infrastructure\transactions2\IdentityMapSpecs.cs" />
     <Compile Include="Infrastructure\transactions2\IIdentityMap.cs" />
     <Compile Include="Infrastructure\cloning\BinarySerializer.cs" />
@@ -586,7 +589,7 @@
     <Compile Include="Testing\spechelpers\contexts\behaves_like_a_repository.cs" />
     <Compile Include="Testing\spechelpers\core\empty_fixture.cs" />
     <Compile Include="Testing\spechelpers\core\IHideObjectMembers.cs" />
-    <Compile Include="Testing\spechelpers\core\method_call_occurance.cs" />
+    <Compile Include="Testing\spechelpers\core\MethodCallOccurance.cs" />
     <Compile Include="Testing\MetaData\run_in_real_container.cs" />
     <Compile Include="Presentation\Views\helpers\Events.cs" />
     <Compile Include="Presentation\Views\helpers\EventTrigger.cs" />