Commit 873512a
Changed files (239)
product
Boot
boot
container
registration
Modules
Properties
DataAccess
Transactions
Domain
Accounting
Presentation
Model
FileSystem
Menu
File
Window
Navigation
Presenters
Views
Winforms
Databinding
Views
Service
Application
Infrastructure
debugging
Eventing
Logging
Security
Threading
Transactions
Service.Contracts
Infrastructure
Logging
Transactions
Properties
utility
product/Boot/boot/container/registration/proxy_configuration/NotifyProgressInterceptor.cs
@@ -1,12 +1,11 @@
using Castle.Core.Interceptor;
+using Gorilla.Commons.Infrastructure.Logging;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- public interface INotifyProgressInterceptor : IInterceptor
- {
- }
+ public interface INotifyProgressInterceptor : IInterceptor {}
public class NotifyProgressInterceptor : INotifyProgressInterceptor
{
@@ -19,9 +18,13 @@ namespace MoMoney.boot.container.registration.proxy_configuration
public void Intercept(IInvocation invocation)
{
- broker.publish(new StartedRunningCommand(invocation.TargetType.Name));
+ this.log().debug("declaring type: {0}", invocation.GetConcreteMethodInvocationTarget().DeclaringType);
+ this.log().debug("target type: {0}", invocation.TargetType);
+ this.log().debug("proxy type: {0}", invocation.Proxy);
+ this.log().debug("invocation target: {0}", invocation.InvocationTarget);
+ broker.publish(new StartedRunningCommand(invocation.InvocationTarget));
invocation.Proceed();
- broker.publish(new FinishedRunningCommand(invocation.TargetType.Name));
+ broker.publish(new FinishedRunningCommand(invocation.InvocationTarget));
}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/proxy_configuration/SynchronizedConfiguration.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
-using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
using Gorilla.Commons.Utility.Core;
+using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.boot.container.registration.proxy_configuration
{
product/Boot/boot/container/registration/proxy_configuration/UnitOfWorkInterceptor.cs
@@ -2,7 +2,6 @@ using Castle.Core.Interceptor;
using Gorilla.Commons.Utility.Core;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
using MoMoney.Service.Infrastructure.Eventing;
-using MoMoney.Service.Infrastructure.Transactions;
namespace MoMoney.boot.container.registration.proxy_configuration
{
product/Boot/boot/container/registration/wire_up_the_data_access_components_into_the.cs
@@ -1,7 +1,6 @@
using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Cloning;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.boot.container.registration.proxy_configuration;
product/Boot/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -1,5 +1,4 @@
using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Log4Net;
using Gorilla.Commons.Infrastructure.Logging;
using Gorilla.Commons.Utility.Core;
@@ -17,8 +16,8 @@ namespace MoMoney.boot.container.registration
public void run()
{
- registration.singleton<IDependencyRegistration>(() => registration);
- registration.singleton<IDependencyRegistry>(() => registration.build());
+ registration.singleton(() => registration);
+ registration.singleton(() => registration.build());
registration.singleton<ILogFactory, Log4NetLogFactory>();
}
}
product/Boot/boot/container/registration/wire_up_the_infrastructure_in_to_the.cs
@@ -3,15 +3,13 @@ using System.ComponentModel;
using System.Deployment.Application;
using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Registries;
-using Gorilla.Commons.Infrastructure.Threading;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
using MoMoney.Service.Infrastructure.Threading;
using MoMoney.Service.Infrastructure.Updating;
-using MoMoney.Tasks.infrastructure.updating;
namespace MoMoney.boot.container.registration
{
product/Boot/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -1,21 +1,17 @@
using System;
-using System.Collections.Generic;
using System.Reflection;
using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Reflection;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.boot.container.registration.proxy_configuration;
-using MoMoney.DTO;
using MoMoney.Presentation;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Menu.Help;
using MoMoney.Presentation.Model.Menu.window;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Commands;
using MoMoney.Presentation.Views;
-using MoMoney.Service.Contracts.Application;
namespace MoMoney.boot.container.registration
{
product/Boot/boot/container/registration/wire_up_the_views_in_to_the.cs
@@ -3,13 +3,6 @@ using System.Windows.Forms;
using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.billing;
-using MoMoney.Presentation.Views.dialogs;
-using MoMoney.Presentation.Views.Menu;
-using MoMoney.Presentation.Views.Navigation;
-using MoMoney.Presentation.Views.Shell;
-using MoMoney.Presentation.Views.Startup;
-using MoMoney.Presentation.Views.updates;
using MoMoney.Presentation.Winforms.Views;
namespace MoMoney.boot.container.registration
product/Boot/boot/hookup.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.windows.ui
+namespace MoMoney.boot
{
class hookup
{
product/Boot/boot/start_the_application.cs
@@ -1,5 +1,4 @@
using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
using MoMoney.Modules.Core;
using MoMoney.Service.Infrastructure.Threading;
product/Boot/boot/WindowsFormsApplication.cs
@@ -8,14 +8,13 @@ using System.Threading;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.boot.container;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
-using MoMoney.windows.ui;
+using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.boot
{
product/Boot/Modules/ApplicationMenuModule.cs
@@ -1,7 +1,6 @@
using MoMoney.Presentation.Model.Menu;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Menu;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/ApplicationShellModule.cs
@@ -1,6 +1,5 @@
using MoMoney.Presentation;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Shell;
namespace MoMoney.Modules
{
product/Boot/Modules/GettingStartedModule.cs
@@ -1,7 +1,6 @@
using MoMoney.Presentation;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Shell;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/ToolbarModule.cs
@@ -1,7 +1,6 @@
using MoMoney.Presentation.Model.Menu;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Shell;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Properties/Resources.Designer.cs
@@ -9,9 +9,6 @@
//------------------------------------------------------------------------------
namespace MoMoney.Properties {
- using System;
-
-
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -39,7 +36,7 @@ namespace MoMoney.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MoMoney.Properties.Resources", typeof(Resources).Assembly);
+ var temp = new global::System.Resources.ResourceManager("MoMoney.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
product/DataAccess/Db40/ConnectionFactory.cs
@@ -1,8 +1,8 @@
using Db4objects.Db4o;
using Db4objects.Db4o.Config;
using Gorilla.Commons.Infrastructure.FileSystem;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Extensions;
+using MoMoney.DataAccess.Transactions;
namespace MoMoney.DataAccess.Db40
{
product/DataAccess/Db40/DatabaseConnection.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Db4objects.Db4o;
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
namespace MoMoney.DataAccess.Db40
{
product/DataAccess/Repositories/AccountHolderRepository.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Domain.accounting;
using MoMoney.Domain.repositories;
product/DataAccess/Repositories/BillRepository.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
product/DataAccess/Repositories/CompanyRepository.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Extensions;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
product/DataAccess/Repositories/IncomeRepository.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
product/DataAccess/Transactions/ChangeTracker.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
product/DataAccess/Transactions/ChangeTrackerFactory.cs
@@ -1,6 +1,5 @@
using System;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
namespace MoMoney.DataAccess.Transactions
product/DataAccess/Transactions/ChangeTrackerFactorySpecs.cs
@@ -1,6 +1,5 @@
using System;
using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
product/DataAccess/Transactions/ChangeTrackerSpecs.cs
@@ -1,6 +1,5 @@
using System;
using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
product/DataAccess/Transactions/Context.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class Context : IContext
{
product/DataAccess/Transactions/ContextFactory.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IContextFactory
{
product/DataAccess/Transactions/ContextFactorySpecs.cs
@@ -2,30 +2,32 @@ using System.Collections;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class ContextFactorySpecs
{
- }
-
- [Concern(typeof (ContextFactory))]
- public class when_creating_a_new_context : concerns_for<IContextFactory, ContextFactory>
- {
- context c = () =>
- {
- scope = an<IScopedStorage>();
- storage = an<IDictionary>();
+ [Concern(typeof (ContextFactory))]
+ public class when_creating_a_new_context : concerns_for<IContextFactory, ContextFactory>
+ {
+ context c = () =>
+ {
+ scope = an<IScopedStorage>();
+ storage = an<IDictionary>();
- when_the(scope).is_told_to(x => x.provide_storage()).it_will_return(storage);
- };
+ when_the(scope).is_told_to(x => x.provide_storage()).it_will_return(storage);
+ };
- because b = () => { result = sut.create_for(scope); };
+ because b = () =>
+ {
+ result = sut.create_for(scope);
+ };
- it should_return_a_context_that_represents_the_specified_scope =
- () => result.should_be_an_instance_of<Context>();
+ it should_return_a_context_that_represents_the_specified_scope =
+ () => result.should_be_an_instance_of<Context>();
- static IDictionary storage;
- static IScopedStorage scope;
- static IContext result;
+ static IDictionary storage;
+ static IScopedStorage scope;
+ static IContext result;
+ }
}
}
\ No newline at end of file
product/DataAccess/Transactions/CurrentThread.cs
@@ -1,6 +1,6 @@
using System.Threading;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class CurrentThread : IThread
{
product/DataAccess/Transactions/IChangeTracker.cs
@@ -1,7 +1,7 @@
using System;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IChangeTracker : IDisposable
{
product/DataAccess/Transactions/IChangeTrackerFactory.cs
@@ -1,7 +1,7 @@
using System;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IChangeTrackerFactory
{
product/DataAccess/Transactions/IContext.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IContext
{
product/DataAccess/Transactions/IDatabase.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IDatabase
{
product/DataAccess/Transactions/IDatabaseConnection.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IDatabaseConnection : IDisposable
{
product/DataAccess/Transactions/IdentityMapProxy.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class IdentityMapProxy<Key, Value> : IIdentityMap<Key, Value> where Value : IIdentifiable<Guid>
{
product/DataAccess/Transactions/IdentityMapSpecs.cs
@@ -1,7 +1,7 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
[Concern(typeof (IdentityMap<,>))]
public class behaves_like_identity_map : concerns_for<IIdentityMap<int, string>, IdentityMap<int, string>>
@@ -18,10 +18,10 @@ namespace Gorilla.Commons.Infrastructure.Transactions
it should_return_the_item_that_was_added_for_the_given_key = () => result.should_be_equal_to("1");
because b = () =>
- {
- sut.add(1, "1");
- result = sut.item_that_belongs_to(1);
- };
+ {
+ sut.add(1, "1");
+ result = sut.item_that_belongs_to(1);
+ };
static string result;
}
@@ -43,10 +43,10 @@ namespace Gorilla.Commons.Infrastructure.Transactions
it should_return_true = () => result.should_be_true();
because b = () =>
- {
- sut.add(10, "10");
- result = sut.contains_an_item_for(10);
- };
+ {
+ sut.add(10, "10");
+ result = sut.contains_an_item_for(10);
+ };
static bool result;
}
@@ -69,11 +69,11 @@ namespace Gorilla.Commons.Infrastructure.Transactions
it should_replace_the_old_item_with_the_new_one = () => result.should_be_equal_to("7");
because b = () =>
- {
- sut.add(6, "6");
- sut.update_the_item_for(6, "7");
- result = sut.item_that_belongs_to(6);
- };
+ {
+ sut.add(6, "6");
+ sut.update_the_item_for(6, "7");
+ result = sut.item_that_belongs_to(6);
+ };
static string result;
}
@@ -85,10 +85,10 @@ namespace Gorilla.Commons.Infrastructure.Transactions
it should_add_the_new_item = () => result.should_be_equal_to("3");
because b = () =>
- {
- sut.update_the_item_for(3, "3");
- result = sut.item_that_belongs_to(3);
- };
+ {
+ sut.update_the_item_for(3, "3");
+ result = sut.item_that_belongs_to(3);
+ };
static string result;
}
product/DataAccess/Transactions/IIdentityMap.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IIdentityMap<TKey, TValue>
{
product/DataAccess/Transactions/IKey.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IKey<T>
{
product/DataAccess/Transactions/IScopedStorage.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IScopedStorage
{
product/DataAccess/Transactions/IStatement.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IStatement
{
product/DataAccess/Transactions/IStatementRegistry.cs
@@ -1,7 +1,7 @@
using System;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IStatementRegistry
{
product/DataAccess/Transactions/IThread.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface IThread
{
product/DataAccess/Transactions/PerThread.cs
@@ -3,7 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Threading;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class PerThread : IContext
{
@@ -39,14 +39,14 @@ namespace Gorilla.Commons.Infrastructure.Transactions
{
var id = Thread.CurrentThread.ManagedThreadId;
within_lock(() =>
- {
- if (!slots.ContainsKey(id))
- {
- var slot = Thread.GetNamedDataSlot(GetType().FullName);
- slots.Add(id, slot);
- Thread.SetData(slot, new Hashtable());
- }
- });
+ {
+ if (!slots.ContainsKey(id))
+ {
+ var slot = Thread.GetNamedDataSlot(GetType().FullName);
+ slots.Add(id, slot);
+ Thread.SetData(slot, new Hashtable());
+ }
+ });
return (IDictionary) Thread.GetData(slots[id]);
}
product/DataAccess/Transactions/PerThreadScopedStorage.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class PerThreadScopedStorage : IScopedStorage
{
product/DataAccess/Transactions/PerThreadScopedStorageSpecs.cs
@@ -1,27 +1,24 @@
-using System;
using System.Collections;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class PerThreadScopedStorageSpecs
{
- }
[Concern(typeof (PerThreadScopedStorage))]
public class when_retrieving_the_storage_for_a_specific_thread :
concerns_for<IScopedStorage, PerThreadScopedStorage>
{
context c = () =>
- {
- thread_id = DateTime.Now.Ticks;
- thread = the_dependency<IThread>();
- storage = new Hashtable();
- when_the(thread)
- .is_told_to(x => x.provide_slot_for<Hashtable>())
- .it_will_return(storage);
- };
+ {
+ thread = the_dependency<IThread>();
+ storage = new Hashtable();
+ when_the(thread)
+ .is_told_to(x => x.provide_slot_for<Hashtable>())
+ .it_will_return(storage);
+ };
because b = () => { result = sut.provide_storage(); };
@@ -29,7 +26,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
static IDictionary result;
static IThread thread;
- static long thread_id;
static Hashtable storage;
}
+ }
}
\ No newline at end of file
product/DataAccess/Transactions/Session.cs
@@ -5,7 +5,7 @@ using Gorilla.Commons.Infrastructure.Logging;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ISession : IDisposable
{
product/DataAccess/Transactions/SessionFactory.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ISessionFactory : IFactory<ISession>
{
product/DataAccess/Transactions/SessionFactorySpecs.cs
@@ -1,7 +1,7 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class SessionFactorySpecs
{
product/DataAccess/Transactions/SessionNotStartedException.cs
@@ -1,6 +1,6 @@
using System;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class SessionNotStartedException : Exception
{
product/DataAccess/Transactions/SessionProvider.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ISessionProvider
{
product/DataAccess/Transactions/SessionSpecs.cs
@@ -4,175 +4,178 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class SessionSpecs
{
- }
-
- public class behaves_like_session : concerns_for<ISession, Session>
- {
- context c = () =>
- {
- transaction = the_dependency<ITransaction>();
- database = the_dependency<IDatabase>();
- };
-
- static protected ITransaction transaction;
- static protected IDatabase database;
- }
-
- [Concern(typeof (Session))]
- public class when_saving_a_transient_item_to_a_session : behaves_like_session
- {
- it should_add_the_entity_to_the_identity_map = () => map.was_told_to(x => x.add(guid, entity));
-
- context c = () =>
- {
- guid = Guid.NewGuid();
- entity = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
-
- when_the(entity).is_told_to(x => x.id).it_will_return(guid);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
- };
-
- because b = () => sut.save(entity);
-
- static ITestEntity entity;
- static IIdentityMap<Guid, ITestEntity> map;
- static Id<Guid> guid;
- }
-
- [Concern(typeof (Session))]
- public class when_commiting_the_changes_made_in_a_session : behaves_like_session
- {
- it should_commit_all_the_changes_from_the_running_transaction =
- () => transaction.was_told_to(x => x.commit_changes());
-
- it should_not_rollback_any_changes_from_the_running_transaction =
- () => transaction.was_not_told_to(x => x.rollback_changes());
-
- because b = () =>
- {
- sut.flush();
- sut.Dispose();
- };
- }
-
- [Concern(typeof (Session))]
- public class when_closing_a_session_before_flushing_the_changes : behaves_like_session
- {
- it should_rollback_any_changes_made_in_the_current_transaction =
- () => transaction.was_told_to(x => x.rollback_changes());
-
- because b = () => sut.Dispose();
- }
-
- [Concern(typeof (Session))]
- public class when_loading_all_instances_of_a_certain_type_and_some_have_already_been_loaded : behaves_like_session
- {
- it should_return_the_items_from_the_cache = () => results.should_contain(cached_item);
-
- it should_exclude_duplicates_from_the_database = () => results.should_not_contain(database_item);
-
- it should_add_items_from_the_database_to_the_identity_map =
- () => identity_map.was_told_to(x => x.add(id_of_the_uncached_item, uncached_item));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- id_of_the_uncached_item = Guid.NewGuid();
- identity_map = an<IIdentityMap<Guid, ITestEntity>>();
- cached_item = an<ITestEntity>();
- database_item = an<ITestEntity>();
- uncached_item = an<ITestEntity>();
-
- when_the(cached_item).is_told_to(x => x.id).it_will_return(id);
- when_the(database_item).is_told_to(x => x.id).it_will_return(id);
- when_the(uncached_item).is_told_to(x => x.id).it_will_return(id_of_the_uncached_item);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return( identity_map);
- when_the(identity_map).is_told_to(x => x.contains_an_item_for(id)).it_will_return(true);
- when_the(identity_map).is_told_to(x => x.all()).it_will_return(cached_item);
- when_the(database).is_told_to(x => x.fetch_all<ITestEntity>())
- .it_will_return(database_item, uncached_item);
- };
-
- because b = () =>
- {
- sut.find<ITestEntity>(id);
- results = sut.all<ITestEntity>();
- };
-
- static IEnumerable<ITestEntity> results;
- static Id<Guid> id;
- static Id<Guid> id_of_the_uncached_item;
- static ITestEntity cached_item;
- static ITestEntity database_item;
- static IIdentityMap<Guid, ITestEntity> identity_map;
- static ITestEntity uncached_item;
- }
-
- [Concern(typeof (Session))]
- public class when_looking_up_a_specific_entity_by_its_id_and_it_has_not_been_loaded_into_the_cache :
- behaves_like_session
- {
- it should_return_that_item = () => { result.should_be_equal_to(correct_item); };
-
- it should_add_that_item_to_the_identity_map = () => map.was_told_to(x => x.add(id, correct_item));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- wrong_item = an<ITestEntity>();
- correct_item = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
- when_the(wrong_item).is_told_to(x => x.id).it_will_return<Id<Guid>>(Guid.NewGuid());
- when_the(correct_item).is_told_to(x => x.id).it_will_return(id);
- when_the(database)
- .is_told_to(x => x.fetch_all<ITestEntity>())
- .it_will_return(wrong_item, correct_item);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>())
- .it_will_return(map);
- };
-
- because b = () => { result = sut.find<ITestEntity>(id); };
-
- static Id<Guid> id;
- static IIdentifiable<Guid> result;
- static ITestEntity correct_item;
- static ITestEntity wrong_item;
- static IIdentityMap<Guid, ITestEntity> map;
- }
-
- [Concern(typeof (Session))]
- public class when_deleting_an_item_from_the_database : behaves_like_session
- {
- it should_remove_that_item_from_the_cache = () => map.was_told_to(x => x.evict(id));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- entity = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
-
- when_the(entity).is_told_to(x => x.id).it_will_return(id);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
- when_the(database).is_told_to(x => x.fetch_all<ITestEntity>()).it_will_return(entity);
- };
-
- because b = () =>
- {
- sut.find<ITestEntity>(id);
- sut.delete(entity);
- };
-
- static Id<Guid> id;
- static IIdentityMap<Guid, ITestEntity> map;
- static ITestEntity entity;
- }
-
- public interface ITestEntity : IIdentifiable<Guid>
- {
+ public class behaves_like_session : concerns_for<ISession, Session>
+ {
+ context c = () =>
+ {
+ transaction = the_dependency<ITransaction>();
+ database = the_dependency<IDatabase>();
+ };
+
+ static protected ITransaction transaction;
+ static protected IDatabase database;
+ }
+
+ [Concern(typeof (Session))]
+ public class when_saving_a_transient_item_to_a_session : behaves_like_session
+ {
+ it should_add_the_entity_to_the_identity_map = () => map.was_told_to(x => x.add(guid, entity));
+
+ context c = () =>
+ {
+ guid = Guid.NewGuid();
+ entity = an<ITestEntity>();
+ map = an<IIdentityMap<Guid, ITestEntity>>();
+
+ when_the(entity).is_told_to(x => x.id).it_will_return(guid);
+ when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
+ };
+
+ because b = () => sut.save(entity);
+
+ static ITestEntity entity;
+ static IIdentityMap<Guid, ITestEntity> map;
+ static Id<Guid> guid;
+ }
+
+ [Concern(typeof (Session))]
+ public class when_commiting_the_changes_made_in_a_session : behaves_like_session
+ {
+ it should_commit_all_the_changes_from_the_running_transaction =
+ () => transaction.was_told_to(x => x.commit_changes());
+
+ it should_not_rollback_any_changes_from_the_running_transaction =
+ () => transaction.was_not_told_to(x => x.rollback_changes());
+
+ because b = () =>
+ {
+ sut.flush();
+ sut.Dispose();
+ };
+ }
+
+ [Concern(typeof (Session))]
+ public class when_closing_a_session_before_flushing_the_changes : behaves_like_session
+ {
+ it should_rollback_any_changes_made_in_the_current_transaction =
+ () => transaction.was_told_to(x => x.rollback_changes());
+
+ because b = () => sut.Dispose();
+ }
+
+ [Concern(typeof (Session))]
+ public class when_loading_all_instances_of_a_certain_type_and_some_have_already_been_loaded : behaves_like_session
+ {
+ it should_return_the_items_from_the_cache = () => results.should_contain(cached_item);
+
+ it should_exclude_duplicates_from_the_database = () => results.should_not_contain(database_item);
+
+ it should_add_items_from_the_database_to_the_identity_map =
+ () => identity_map.was_told_to(x => x.add(id_of_the_uncached_item, uncached_item));
+
+ context c = () =>
+ {
+ id = Guid.NewGuid();
+ id_of_the_uncached_item = Guid.NewGuid();
+ identity_map = an<IIdentityMap<Guid, ITestEntity>>();
+ cached_item = an<ITestEntity>();
+ database_item = an<ITestEntity>();
+ uncached_item = an<ITestEntity>();
+
+ when_the(cached_item).is_told_to(x => x.id).it_will_return(id);
+ when_the(database_item).is_told_to(x => x.id).it_will_return(id);
+ when_the(uncached_item).is_told_to(x => x.id).it_will_return(id_of_the_uncached_item);
+ when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(identity_map);
+ when_the(identity_map).is_told_to(x => x.contains_an_item_for(id)).it_will_return(true);
+ when_the(identity_map).is_told_to(x => x.all()).it_will_return(cached_item);
+ when_the(database).is_told_to(x => x.fetch_all<ITestEntity>())
+ .it_will_return(database_item, uncached_item);
+ };
+
+ because b = () =>
+ {
+ sut.find<ITestEntity>(id);
+ results = sut.all<ITestEntity>();
+ };
+
+ static IEnumerable<ITestEntity> results;
+ static Id<Guid> id;
+ static Id<Guid> id_of_the_uncached_item;
+ static ITestEntity cached_item;
+ static ITestEntity database_item;
+ static IIdentityMap<Guid, ITestEntity> identity_map;
+ static ITestEntity uncached_item;
+ }
+
+ [Concern(typeof (Session))]
+ public class when_looking_up_a_specific_entity_by_its_id_and_it_has_not_been_loaded_into_the_cache :
+ behaves_like_session
+ {
+ it should_return_that_item = () =>
+ {
+ result.should_be_equal_to(correct_item);
+ };
+
+ it should_add_that_item_to_the_identity_map = () => map.was_told_to(x => x.add(id, correct_item));
+
+ context c = () =>
+ {
+ id = Guid.NewGuid();
+ wrong_item = an<ITestEntity>();
+ correct_item = an<ITestEntity>();
+ map = an<IIdentityMap<Guid, ITestEntity>>();
+ when_the(wrong_item).is_told_to(x => x.id).it_will_return<Id<Guid>>(Guid.NewGuid());
+ when_the(correct_item).is_told_to(x => x.id).it_will_return(id);
+ when_the(database)
+ .is_told_to(x => x.fetch_all<ITestEntity>())
+ .it_will_return(wrong_item, correct_item);
+ when_the(transaction).is_told_to(x => x.create_for<ITestEntity>())
+ .it_will_return(map);
+ };
+
+ because b = () =>
+ {
+ result = sut.find<ITestEntity>(id);
+ };
+
+ static Id<Guid> id;
+ static IIdentifiable<Guid> result;
+ static ITestEntity correct_item;
+ static ITestEntity wrong_item;
+ static IIdentityMap<Guid, ITestEntity> map;
+ }
+
+ [Concern(typeof (Session))]
+ public class when_deleting_an_item_from_the_database : behaves_like_session
+ {
+ it should_remove_that_item_from_the_cache = () => map.was_told_to(x => x.evict(id));
+
+ context c = () =>
+ {
+ id = Guid.NewGuid();
+ entity = an<ITestEntity>();
+ map = an<IIdentityMap<Guid, ITestEntity>>();
+
+ when_the(entity).is_told_to(x => x.id).it_will_return(id);
+ when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
+ when_the(database).is_told_to(x => x.fetch_all<ITestEntity>()).it_will_return(entity);
+ };
+
+ because b = () =>
+ {
+ sut.find<ITestEntity>(id);
+ sut.delete(entity);
+ };
+
+ static Id<Guid> id;
+ static IIdentityMap<Guid, ITestEntity> map;
+ static ITestEntity entity;
+ }
+
+ public interface ITestEntity : IIdentifiable<Guid> {}
}
}
\ No newline at end of file
product/DataAccess/Transactions/SingletonScopedStorage.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class SingletonScopedStorage : IScopedStorage
{
product/DataAccess/Transactions/StatementRegistry.cs
@@ -1,7 +1,7 @@
using System;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class StatementRegistry : IStatementRegistry
{
product/DataAccess/Transactions/TrackerEntry.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using Gorilla.Commons.Infrastructure.Logging;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ITrackerEntry<T>
{
product/DataAccess/Transactions/TrackerEntryMapper.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Infrastructure.Cloning;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ITrackerEntryMapper<T> : IMapper<T, ITrackerEntry<T>>
{
product/DataAccess/Transactions/TrackerEntrySpecs.cs
@@ -4,7 +4,7 @@ using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class TrackerEntrySpecs
{
@@ -55,11 +55,11 @@ namespace Gorilla.Commons.Infrastructure.Transactions
because b = () => { result = sut.has_changes(); };
context c = () =>
- {
- var id = Guid.NewGuid();
- original = new Pillow("green", id);
- current = new Pillow(null, id);
- };
+ {
+ var id = Guid.NewGuid();
+ original = new Pillow("green", id);
+ current = new Pillow(null, id);
+ };
public override ITrackerEntry<Pillow> create_sut()
{
@@ -80,11 +80,11 @@ namespace Gorilla.Commons.Infrastructure.Transactions
because b = () => { result = sut.has_changes(); };
context c = () =>
- {
- var id = Guid.NewGuid();
- original = new Pillow("green", id);
- current = new Pillow("green", id);
- };
+ {
+ var id = Guid.NewGuid();
+ original = new Pillow("green", id);
+ current = new Pillow("green", id);
+ };
public override ITrackerEntry<Pillow> create_sut()
{
product/DataAccess/Transactions/Transaction.cs
@@ -4,7 +4,7 @@ using System.Linq;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public interface ITransaction
{
product/DataAccess/Transactions/TransactionSpecs.cs
@@ -3,7 +3,7 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class TransactionSpecs
{
@@ -13,10 +13,10 @@ namespace Gorilla.Commons.Infrastructure.Transactions
public class behaves_like_transaction : concerns_for<ITransaction, Transaction>
{
context c = () =>
- {
- database = the_dependency<IDatabase>();
- factory = the_dependency<IChangeTrackerFactory>();
- };
+ {
+ database = the_dependency<IDatabase>();
+ factory = the_dependency<IChangeTrackerFactory>();
+ };
static protected IDatabase database;
static protected IChangeTrackerFactory factory;
@@ -36,24 +36,24 @@ namespace Gorilla.Commons.Infrastructure.Transactions
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<IChangeTracker<IMovie>>(x => x.commit_to(database));
+ () => tracker.was_told_to(x => x.commit_to(database));
context c = () =>
- {
- movie = new Movie("Goldeneye");
- tracker = an<IChangeTracker<IMovie>>();
+ {
+ movie = new Movie("Goldeneye");
+ tracker = an<IChangeTracker<IMovie>>();
- 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);
- };
+ 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.create_for<IMovie>().add(movie.id, movie);
- movie.change_name_to("Austin Powers");
- sut.commit_changes();
- };
+ {
+ sut.create_for<IMovie>().add(movie.id, movie);
+ movie.change_name_to("Austin Powers");
+ sut.commit_changes();
+ };
static IMovie movie;
static IChangeTracker<IMovie> tracker;
@@ -67,21 +67,21 @@ namespace Gorilla.Commons.Infrastructure.Transactions
it should_delete_all_items_marked_for_deletion = () => tracker.was_told_to(x => x.commit_to(database));
context c = () =>
- {
- movie = new Movie("Goldeneye");
- tracker = an<IChangeTracker<IMovie>>();
+ {
+ movie = new Movie("Goldeneye");
+ tracker = an<IChangeTracker<IMovie>>();
- 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);
- };
+ 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 = () =>
- {
- var map = sut.create_for<IMovie>();
- map.add(movie.id, movie);
- map.evict(movie.id);
- sut.commit_changes();
- };
+ {
+ var map = sut.create_for<IMovie>();
+ map.add(movie.id, movie);
+ map.evict(movie.id);
+ sut.commit_changes();
+ };
static IMovie movie;
static IChangeTracker<IMovie> tracker;
product/DataAccess/Transactions/TypedKey.cs
@@ -1,6 +1,6 @@
using System.Collections;
-namespace Gorilla.Commons.Infrastructure.Transactions
+namespace MoMoney.DataAccess.Transactions
{
public class TypedKey<T> : IKey<T>
{
product/DataAccess/IConnectionFactory.cs
@@ -1,5 +1,5 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
namespace MoMoney.DataAccess
{
product/DataAccess/ObjectDatabase.cs
@@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Gorilla.Commons.Infrastructure.FileSystem;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
+using MoMoney.DataAccess.Transactions;
namespace MoMoney.DataAccess
{
product/Domain/Accounting/GeneralLedgerSpecs.cs
@@ -36,7 +36,7 @@ namespace MoMoney.Domain.accounting
};
it should_not_return_any_entries_that_were_not_posted_for_that_month =
- () => Assertions.should_not_contain(result, april_first);
+ () => result.should_not_contain(april_first);
context c = () =>
{
product/Presentation/Core/ApplicationControllerSpecs.cs
@@ -1,7 +1,6 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Core
{
product/Presentation/Core/ContentPresenter.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Core
{
product/Presentation/Core/IContentPresenter.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Core
{
product/Presentation/Model/FileSystem/folder.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Model.file_system
+namespace MoMoney.Presentation.Model.FileSystem
{
public interface IFolder
{
product/Presentation/Model/Menu/File/CloseProjectCommand.cs
@@ -2,7 +2,7 @@ using Gorilla.Commons.Infrastructure.Logging;
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface ICloseCommand : ICommand, ISaveChangesCallback, ILoggable
{
product/Presentation/Model/Menu/File/CloseWindowCommand.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface ICloseWindowCommand : ICommand
{
product/Presentation/Model/Menu/File/ExitCommand.cs
@@ -3,7 +3,7 @@ using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface IExitCommand : ICommand, ISaveChangesCallback
{
product/Presentation/Model/Menu/File/ExitCommandSpecs.cs
@@ -4,7 +4,7 @@ using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
[Concern(typeof (ExitCommand))]
public abstract class behaves_like_exit_command : concerns_for<IExitCommand>
@@ -15,11 +15,11 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
}
context c = () =>
- {
- application = the_dependency<IApplication>();
- broker = the_dependency<IEventAggregator>();
- save_changes_command = the_dependency<ISaveChangesCommand>();
- };
+ {
+ application = the_dependency<IApplication>();
+ broker = the_dependency<IEventAggregator>();
+ save_changes_command = the_dependency<ISaveChangesCommand>();
+ };
protected static IApplication application;
protected static IEventAggregator broker;
product/Presentation/Model/Menu/File/FileMenu.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using MoMoney.Presentation.Model.Menu.File.Commands;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Winforms.Keyboard;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Model/Menu/File/NewCommand.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface INewCommand : ICommand, ISaveChangesCallback
{
product/Presentation/Model/Menu/File/NewCommandSpecs.cs
@@ -2,16 +2,16 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
[Concern(typeof (NewCommand))]
public abstract class behaves_like_new_command : concerns_for<INewCommand, NewCommand>
{
context c = () =>
- {
- current_project = the_dependency<IProjectController>();
- save_changes_command = the_dependency<ISaveChangesCommand>();
- };
+ {
+ current_project = the_dependency<IProjectController>();
+ save_changes_command = the_dependency<ISaveChangesCommand>();
+ };
protected static IProjectController current_project;
protected static ISaveChangesCommand save_changes_command;
product/Presentation/Model/Menu/File/OpenCommand.cs
@@ -1,8 +1,8 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface IOpenCommand : ICommand, ISaveChangesCallback
{
product/Presentation/Model/Menu/File/OpenCommandSpecs.cs
@@ -2,19 +2,19 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
[Concern(typeof (OpenCommand))]
public abstract class behaves_like_command_to_open_a_project : concerns_for<IOpenCommand, OpenCommand>
{
context c = () =>
- {
- view = the_dependency<ISelectFileToOpenDialog>();
- project = the_dependency<IProjectController>();
- save_changes_command = the_dependency<ISaveChangesCommand>();
- };
+ {
+ view = the_dependency<ISelectFileToOpenDialog>();
+ project = the_dependency<IProjectController>();
+ save_changes_command = the_dependency<ISaveChangesCommand>();
+ };
protected static IProjectController project;
protected static ISelectFileToOpenDialog view;
@@ -37,10 +37,10 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
() => project.was_told_to(x => x.open_project_from(file_path));
context c = () =>
- {
- file_path = "blah_blah";
- when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
- };
+ {
+ file_path = "blah_blah";
+ when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
+ };
because b = () => sut.saved();
@@ -54,10 +54,10 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
() => project.was_told_to(x => x.open_project_from(file_path));
context c = () =>
- {
- file_path = "blah_blah";
- when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
- };
+ {
+ file_path = "blah_blah";
+ when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
+ };
because b = () => sut.not_saved();
@@ -72,10 +72,10 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
() => project.was_not_told_to(x => x.open_project_from(file_path));
context c = () =>
- {
- file_path = "blah_blah";
- when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
- };
+ {
+ file_path = "blah_blah";
+ when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(file_path);
+ };
because b = () => sut.cancelled();
product/Presentation/Model/Menu/File/SaveAsCommand.cs
@@ -1,8 +1,8 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface ISaveAsCommand : ICommand
{
product/Presentation/Model/Menu/File/SaveAsCommandSpecs.cs
@@ -2,9 +2,9 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
[Concern(typeof (SaveAsCommand))]
public class when_saving_the_current_project_to_a_new_file_path : concerns_for<ISaveAsCommand, SaveAsCommand>
@@ -12,13 +12,13 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
it should_save_the_current_project_to_the_new_path = () => current_project.was_told_to(x => x.save_project_to(new_path));
context c = () =>
- {
- current_project = an<IProjectController>();
- view = an<ISelectFileToSaveToDialog>();
- new_path = "blah_blah";
+ {
+ current_project = an<IProjectController>();
+ view = an<ISelectFileToSaveToDialog>();
+ new_path = "blah_blah";
- when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(new_path);
- };
+ when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(new_path);
+ };
because b = () => sut.run();
product/Presentation/Model/Menu/File/SaveChangesCommand.cs
@@ -2,9 +2,9 @@ using System;
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface ISaveChangesCommand : IParameterizedCommand<ISaveChangesCallback>
{
product/Presentation/Model/Menu/File/SaveCommand.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
public interface ISaveCommand : ICommand
{
product/Presentation/Model/Menu/File/SaveCommandSpecs.cs
@@ -2,7 +2,7 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File.Commands
+namespace MoMoney.Presentation.Model.Menu.File
{
[Concern(typeof (SaveCommand))]
public abstract class behaves_like_the_save_command : concerns_for<ISaveCommand, SaveCommand>
@@ -13,10 +13,10 @@ namespace MoMoney.Presentation.Model.Menu.File.Commands
}
context c = () =>
- {
- current_project = an<IProjectController>();
- save_as_command = an<ISaveAsCommand>();
- };
+ {
+ current_project = an<IProjectController>();
+ save_as_command = an<ISaveAsCommand>();
+ };
protected static ISaveAsCommand save_as_command;
protected static IProjectController current_project;
}
product/Presentation/Model/Menu/Help/display_information_about_the_application.cs
@@ -1,8 +1,7 @@
using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Menu.Help;
-namespace MoMoney.Presentation.Model.Menu.Help.commands
+namespace MoMoney.Presentation.Model.Menu.Help
{
public interface IDisplayInformationAboutTheApplication : ICommand
{
product/Presentation/Model/Menu/Help/HelpMenu.cs
@@ -1,9 +1,5 @@
-using System;
using System.Collections.Generic;
-using MoMoney.Presentation.Model.Menu.Help.commands;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Presenters.updates;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Model.Menu.Help
product/Presentation/Model/Menu/Window/WindowMenu.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoMoney.Presentation.Model.Menu.File.Commands;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Model.Menu.window
product/Presentation/Model/Projects/ProjectController.cs
@@ -4,8 +4,8 @@ using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Contracts.Infrastructure;
+using MoMoney.Service.Contracts.Infrastructure.Transactions;
using MoMoney.Service.Infrastructure.Eventing;
-using MoMoney.Service.Infrastructure.Transactions;
namespace MoMoney.Presentation.Model.Projects
{
product/Presentation/Model/Projects/ProjectControllerSpecs.cs
@@ -5,8 +5,8 @@ using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Contracts.Infrastructure;
+using MoMoney.Service.Contracts.Infrastructure.Transactions;
using MoMoney.Service.Infrastructure.Eventing;
-using MoMoney.Service.Infrastructure.Transactions;
namespace MoMoney.Presentation.Model.Projects
{
@@ -34,7 +34,6 @@ namespace MoMoney.Presentation.Model.Projects
context c = () =>
{
file_to_update = an<IFile>();
- current_file = an<IFile>();
when_the(file_to_update).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
};
@@ -45,7 +44,6 @@ namespace MoMoney.Presentation.Model.Projects
};
static IFile file_to_update;
- static IFile current_file;
}
public class when_attempting_to_save_the_changes_to_a_project_and_a_file_to_save_to_has_not_been_specified :
product/Presentation/Presenters/AboutTheApplicationPresenter.cs
@@ -1,7 +1,7 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.Menu;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Presenters.Menu.Help
+namespace MoMoney.Presentation.Presenters
{
public interface IAboutApplicationPresenter : IContentPresenter
{
product/Presentation/Presenters/AddBillingTaskPane.cs
@@ -1,5 +1,3 @@
-using MoMoney.Presentation.Presenters.billing;
-using MoMoney.Presentation.Presenters.Navigation;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddBillPaymentPresenter.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.billing;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters.billing
+namespace MoMoney.Presentation.Presenters
{
public interface IAddBillPaymentPresenter : IContentPresenter
{
product/Presentation/Presenters/AddCompanyTaskPane.cs
@@ -1,4 +1,3 @@
-using MoMoney.Presentation.Presenters.Navigation;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddIncomeTaskPane.cs
@@ -1,4 +1,3 @@
-using MoMoney.Presentation.Presenters.Navigation;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddNewIncomePresenterSpecs.cs
@@ -5,17 +5,17 @@ using MoMoney.DTO;
using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters.income
+namespace MoMoney.Presentation.Presenters
{
[Concern(typeof (AddNewIncomePresenter))]
public abstract class behaves_like_add_new_income_presenter :
concerns_for<IAddNewIncomePresenter, AddNewIncomePresenter>
{
context c = () =>
- {
- view = the_dependency<IAddNewIncomeView>();
- pump = the_dependency<ICommandPump>();
- };
+ {
+ view = the_dependency<IAddNewIncomeView>();
+ pump = the_dependency<ICommandPump>();
+ };
static protected ICommandPump pump;
static protected IAddNewIncomeView view;
product/Presentation/Presenters/AddReportingTaskPane.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.Navigation;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Contracts.Application;
product/Presentation/Presenters/ApplicationMenuPresenter.cs
@@ -2,9 +2,9 @@ using System.Windows.Forms;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Presenters.Menu
+namespace MoMoney.Presentation.Presenters
{
public interface IApplicationMenuPresenter : IPresenter
{
product/Presentation/Presenters/ApplicationShellPresenter.cs
@@ -1,10 +1,10 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.Menu.File.Commands;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface IApplicationShellPresenter : IPresenter, IEventSubscriber<ClosingProjectEvent>
{
product/Presentation/Presenters/Build.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
{
public class Build
{
product/Presentation/Presenters/CheckForUpdatesPresenter.cs
@@ -3,13 +3,10 @@ using Gorilla.Commons.Utility;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Presenters.Commands;
-using MoMoney.Presentation.Views.updates;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Infrastructure.Updating;
-using MoMoney.Service.Infrastructure.Updating;
-using MoMoney.Tasks.infrastructure.updating;
-namespace MoMoney.Presentation.Presenters.updates
+namespace MoMoney.Presentation.Presenters
{
public interface ICheckForUpdatesPresenter : IPresenter, ICallback<Percent>
{
product/Presentation/Presenters/CheckForUpdatesPresenterSpecs.cs
@@ -3,23 +3,20 @@ using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.Commands;
-using MoMoney.Presentation.Views.updates;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Infrastructure.Updating;
-using MoMoney.Service.Infrastructure.Updating;
-using MoMoney.Tasks.infrastructure.updating;
-namespace MoMoney.Presentation.Presenters.updates
+namespace MoMoney.Presentation.Presenters
{
[Concern(typeof (CheckForUpdatesPresenter))]
public abstract class behaves_like_check_for_updates_presenter :
concerns_for<ICheckForUpdatesPresenter, CheckForUpdatesPresenter>
{
context c = () =>
- {
- view = the_dependency<ICheckForUpdatesView>();
- pump = the_dependency<ICommandPump>();
- };
+ {
+ view = the_dependency<ICheckForUpdatesView>();
+ pump = the_dependency<ICommandPump>();
+ };
static protected ICheckForUpdatesView view;
static protected ICommandPump pump;
product/Presentation/Presenters/CommandFactory.cs
@@ -1,6 +1,5 @@
-using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Presentation.Presenters.Commands;
+using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Presenters
{
product/Presentation/Presenters/display_the_splash_screen.cs
@@ -1,8 +1,8 @@
using System;
-using MoMoney.Presentation.Views.Startup;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters.Startup
+namespace MoMoney.Presentation.Presenters
{
public class display_the_splash_screen : ISplashScreenState
{
product/Presentation/Presenters/ExpandoBuilder.cs
@@ -5,7 +5,7 @@ using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using XPExplorerBar;
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
{
public interface IExpandoBuilder : IBuilder<Expando>
{
product/Presentation/Presenters/GettingStartedPresenter.cs
@@ -1,7 +1,7 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface IGettingStartedPresenter : IContentPresenter
{
product/Presentation/Presenters/GettingStartedPresenterSpecs.cs
@@ -1,9 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public class GettingStartedPresenterSpecs
{
@@ -11,10 +11,10 @@ namespace MoMoney.Presentation.Presenters.Shell
concerns_for<IGettingStartedPresenter, GettingStartedPresenter>
{
context c = () =>
- {
- view = the_dependency<IGettingStartedView>();
- broker = the_dependency<IEventAggregator>();
- };
+ {
+ view = the_dependency<IGettingStartedView>();
+ broker = the_dependency<IEventAggregator>();
+ };
static protected IEventAggregator broker;
static protected IGettingStartedView view;
product/Presentation/Presenters/hide_the_splash_screen.cs
@@ -1,8 +1,8 @@
using System;
-using MoMoney.Presentation.Views.Startup;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters.Startup
+namespace MoMoney.Presentation.Presenters
{
public class hide_the_splash_screen : ISplashScreenState
{
product/Presentation/Presenters/IActionTaskPaneFactory.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Utility.Core;
using XPExplorerBar;
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
{
public interface IActionTaskPaneFactory : IFactory<Expando>
{
product/Presentation/Presenters/ISplashScreenState.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Presenters.Startup
+namespace MoMoney.Presentation.Presenters
{
public interface ISplashScreenState
{
product/Presentation/Presenters/LogFilePresenter.cs
@@ -1,8 +1,8 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.Shell;
-using MoMoney.Service.Infrastructure.Logging;
+using MoMoney.Presentation.Views;
+using MoMoney.Service.Contracts.Infrastructure.Logging;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface ILogFilePresenter : IContentPresenter
{
product/Presentation/Presenters/LogFileViewPresenterSpecs.cs
@@ -1,17 +1,17 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views.Shell;
-using MoMoney.Service.Infrastructure.Logging;
+using MoMoney.Presentation.Views;
+using MoMoney.Service.Contracts.Infrastructure.Logging;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public class behaves_like_log_file_presenter : concerns_for<ILogFilePresenter, LogFilePresenter>
{
context c = () =>
- {
- view = the_dependency<ILogFileView>();
- tasks = the_dependency<ILogFileTasks>();
- };
+ {
+ view = the_dependency<ILogFileView>();
+ tasks = the_dependency<ILogFileTasks>();
+ };
static protected ILogFileView view;
static protected ILogFileTasks tasks;
@@ -22,12 +22,12 @@ namespace MoMoney.Presentation.Presenters.Shell
it should_display_the_contents_of_the_log_file = () => view.was_told_to(x => x.display(log_file_path));
context c = () =>
- {
- log_file_path = "log.txt";
- log_file_contents = "hello_jello";
- tasks.is_told_to(x => x.get_the_path_to_the_log_file()).it_will_return(log_file_path);
- tasks.is_told_to(x => x.get_the_contents_of_the_log_file()).it_will_return(log_file_contents);
- };
+ {
+ log_file_path = "log.txt";
+ log_file_contents = "hello_jello";
+ tasks.is_told_to(x => x.get_the_path_to_the_log_file()).it_will_return(log_file_path);
+ tasks.is_told_to(x => x.get_the_contents_of_the_log_file()).it_will_return(log_file_contents);
+ };
because b = () => sut.run();
product/Presentation/Presenters/MainMenuPresenter.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Presenters.Navigation;
using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Presenters
product/Presentation/Presenters/NotificationIconPresenter.cs
@@ -1,10 +1,10 @@
using System.Net.NetworkInformation;
using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface INotificationIconPresenter : IModule,
IEventSubscriber<ClosingTheApplication>,
product/Presentation/Presenters/NotificationIconPresenterSpecs.cs
@@ -1,10 +1,10 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
[Concern(typeof (NotificationIconPresenter))]
public abstract class behaves_like_notification_icon_presenter : concerns_for<INotificationIconPresenter, NotificationIconPresenter>
@@ -15,10 +15,10 @@ namespace MoMoney.Presentation.Presenters.Shell
//}
context c = () =>
- {
- view = the_dependency<INotificationIconView>();
- broker = the_dependency<IEventAggregator>();
- };
+ {
+ view = the_dependency<INotificationIconView>();
+ broker = the_dependency<IEventAggregator>();
+ };
protected static INotificationIconView view;
protected static IEventAggregator broker;
product/Presentation/Presenters/NotificationPresenter.cs
@@ -3,7 +3,7 @@ using System.Windows.Forms;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public class NotificationPresenter : INotification
{
product/Presentation/Presenters/ProcessQueryCommand.cs
@@ -1,6 +1,6 @@
using System;
-using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
+using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Presenters
{
product/Presentation/Presenters/RestartCommand.cs
@@ -3,7 +3,7 @@ using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.messages;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Commands
+namespace MoMoney.Presentation.Presenters
{
public interface IRestartCommand : ICommand
{
product/Presentation/Presenters/RunQueryCommand.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Presentation.Presenters.Commands
+namespace MoMoney.Presentation.Presenters
{
public interface IRunQueryCommand<T> : ICommand
{
product/Presentation/Presenters/RunThe.cs
@@ -2,7 +2,7 @@ using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Core;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters.Commands
+namespace MoMoney.Presentation.Presenters
{
public interface IRunThe<TPresenter> : ICommand where TPresenter : IPresenter
{
product/Presentation/Presenters/RunTheSpecs.cs
@@ -4,7 +4,7 @@ using MbUnit.Framework;
using MoMoney.Presentation.Core;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters.Commands
+namespace MoMoney.Presentation.Presenters
{
public class RunTheSpecs
{
@@ -19,10 +19,10 @@ namespace MoMoney.Presentation.Presenters.Commands
it should_initialize_the_presenter_that_controls_that_region = () => processor.was_told_to(x => x.add(() => controller.run<IPresenter>()));
context c = () =>
- {
- controller = the_dependency<IApplicationController>();
- processor = the_dependency<ICommandProcessor>();
- };
+ {
+ controller = the_dependency<IApplicationController>();
+ processor = the_dependency<ICommandProcessor>();
+ };
because b = () => sut.run();
product/Presentation/Presenters/SplashScreenPresenter.cs
@@ -1,6 +1,4 @@
-using Gorilla.Commons.Infrastructure.Threading;
-using MoMoney.Presentation.Presenters.Startup;
-using MoMoney.Presentation.Views.Startup;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Views;
using MoMoney.Service.Infrastructure.Threading;
using MoMoney.Utility.Core;
product/Presentation/Presenters/SplashScreenPresenterSpecs.cs
@@ -1,10 +1,10 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views.Startup;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters.Startup
+namespace MoMoney.Presentation.Presenters
{
[Concern(typeof (SplashScreenPresenter))]
public abstract class behaves_like_splash_screen_presenter : concerns_for<ISplashScreenPresenter>
@@ -15,10 +15,10 @@ namespace MoMoney.Presentation.Presenters.Startup
}
context c = () =>
- {
- timer = the_dependency<ITimer>();
- view = the_dependency<ISplashScreenView>();
- };
+ {
+ timer = the_dependency<ITimer>();
+ view = the_dependency<ISplashScreenView>();
+ };
protected static ITimer timer;
protected static ISplashScreenView view;
@@ -41,10 +41,10 @@ namespace MoMoney.Presentation.Presenters.Startup
context c = () => when_the(view).is_asked_for(v => v.current_opacity()).it_will_return(0.5);
because b = () =>
- {
- sut.run();
- sut.notify();
- };
+ {
+ sut.run();
+ sut.notify();
+ };
}
public class when_the_timer_notifies_the_presenter_to_update_and_the_opacity_of_the_view_has_reached_100_percent :
@@ -55,10 +55,10 @@ namespace MoMoney.Presentation.Presenters.Startup
context c = () => when_the(view).is_asked_for(v => v.current_opacity()).it_will_return(1);
because b = () =>
- {
- sut.run();
- sut.notify();
- };
+ {
+ sut.run();
+ sut.notify();
+ };
}
public class when_hiding_the_splash_screen : behaves_like_splash_screen_presenter
@@ -71,10 +71,10 @@ namespace MoMoney.Presentation.Presenters.Startup
context c = () => when_the(view).is_asked_for(v => v.current_opacity()).it_will_return(.5);
because b = () =>
- {
- sut.Dispose();
- sut.notify();
- };
+ {
+ sut.Dispose();
+ sut.notify();
+ };
}
public class when_the_splash_screen_is_fading_away_and_its_opacity_has_reached_zero :
@@ -87,9 +87,9 @@ namespace MoMoney.Presentation.Presenters.Startup
context c = () => when_the(view).is_asked_for(v => v.current_opacity()).it_will_return(0);
because b = () =>
- {
- sut.Dispose();
- sut.notify();
- };
+ {
+ sut.Dispose();
+ sut.notify();
+ };
}
}
\ No newline at end of file
product/Presentation/Presenters/StatusBarPresenterSpecs.cs
@@ -3,7 +3,6 @@ using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
-using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Presentation.Presenters
{
@@ -14,14 +13,12 @@ namespace MoMoney.Presentation.Presenters
() => view.was_told_to(v => v.display(ApplicationIcons.green_circle, "Ready"));
context c = () =>
- {
- view = the_dependency<IStatusBarView>();
- broker = the_dependency<IEventAggregator>();
- };
+ {
+ view = the_dependency<IStatusBarView>();
+ };
because b = () => sut.notify(new NewProjectOpened(""));
static IStatusBarView view;
- static IEventAggregator broker;
}
}
\ No newline at end of file
product/Presentation/Presenters/TaskTrayPresenter.cs
@@ -1,17 +1,18 @@
+using System.ComponentModel;
+using Gorilla.Commons.Infrastructure.Logging;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
+using momoney.utility;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface ITaskTrayPresenter : IModule,
IEventSubscriber<SavedChangesEvent>,
IEventSubscriber<StartedRunningCommand>,
IEventSubscriber<FinishedRunningCommand>,
- IEventSubscriber<NewProjectOpened>
- {
- }
+ IEventSubscriber<NewProjectOpened> {}
public class TaskTrayPresenter : ITaskTrayPresenter
{
@@ -44,7 +45,16 @@ namespace MoMoney.Presentation.Presenters.Shell
public void notify(StartedRunningCommand message)
{
- view.display("Running... {0}".formatted_using(message.running_action));
+ this.log().debug("running {0}", message.running_action);
+ if (message.running_action.is_decorated_with<DisplayNameAttribute>())
+ {
+ var attribute = message.running_action.attribute<DisplayNameAttribute>();
+ view.display("Running... {0}".formatted_using(attribute.DisplayName));
+ }
+ else
+ {
+ view.display("Running... {0}".formatted_using(message.running_action));
+ }
}
public void notify(FinishedRunningCommand message)
product/Presentation/Presenters/TitleBarPresenter.cs
@@ -4,7 +4,7 @@ using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface ITitleBarPresenter : IModule,
IEventSubscriber<UnsavedChangesEvent>,
product/Presentation/Presenters/TitleBarPresenterSpecs.cs
@@ -5,17 +5,17 @@ using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
[Concern(typeof (TitleBarPresenter))]
public abstract class behaves_like_a_title_bar_presenter : concerns_for<ITitleBarPresenter, TitleBarPresenter>
{
context c = () =>
- {
- project = the_dependency<IProjectController>();
- view = the_dependency<ITitleBar>();
- broker = the_dependency<IEventAggregator>();
- };
+ {
+ project = the_dependency<IProjectController>();
+ view = the_dependency<ITitleBar>();
+ broker = the_dependency<IEventAggregator>();
+ };
protected static ITitleBar view;
protected static IEventAggregator broker;
product/Presentation/Presenters/ToolBarPresenter.cs
@@ -3,12 +3,12 @@ using System.Windows.Forms;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Model.Menu.File.Commands;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface IToolbarPresenter : IPresenter
{
product/Presentation/Presenters/UnhandledErrorPresenter.cs
@@ -1,10 +1,9 @@
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Presenters.Commands;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public interface IUnhandledErrorPresenter : IModule, IPresenter,
IEventSubscriber<UnhandledErrorOccurred>
product/Presentation/Presenters/UnhandledErrorPresenterSpecs.cs
@@ -2,10 +2,10 @@ using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters.Shell
+namespace MoMoney.Presentation.Presenters
{
public class behaves_like_unhandled_error_presenter :
concerns_for<IUnhandledErrorPresenter, UnhandledErrorPresenter>
@@ -16,10 +16,10 @@ namespace MoMoney.Presentation.Presenters.Shell
//}
context c = () =>
- {
- view = the_dependency<IUnhandledErrorView>();
- broker = the_dependency<IEventAggregator>();
- };
+ {
+ view = the_dependency<IUnhandledErrorView>();
+ broker = the_dependency<IEventAggregator>();
+ };
protected static IUnhandledErrorView view;
protected static IEventAggregator broker;
product/Presentation/Presenters/ViewAllBillsPresenter.cs
@@ -4,7 +4,7 @@ using MoMoney.Presentation.Core;
using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters.billing
+namespace MoMoney.Presentation.Presenters
{
public interface IViewAllBillsPresenter : IContentPresenter
{
product/Presentation/Views/ControlAction.cs
@@ -1,6 +1,6 @@
using System;
-namespace MoMoney.Presentation.Views.Core
+namespace MoMoney.Presentation.Views
{
public delegate void ControlAction<T>(T input) where T : EventArgs;
}
\ No newline at end of file
product/Presentation/Views/IAboutApplicationView.cs
@@ -1,6 +1,4 @@
-using MoMoney.Presentation.Views.Core;
-
-namespace MoMoney.Presentation.Views.Menu
+namespace MoMoney.Presentation.Views
{
public interface IAboutApplicationView : IDockedContentView
{
product/Presentation/Views/IAddBillPaymentView.cs
@@ -1,10 +1,9 @@
using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.billing;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
-namespace MoMoney.Presentation.Views.billing
+namespace MoMoney.Presentation.Views
{
public interface IAddBillPaymentView : IDockedContentView,
IView<IAddBillPaymentPresenter>,
product/Presentation/Views/IAddCompanyView.cs
@@ -2,7 +2,6 @@ using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/IAddNewIncomeView.cs
@@ -2,7 +2,6 @@ using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/IApplicationDockedWindow.cs
@@ -1,4 +1,3 @@
-using MoMoney.Presentation.Views.Core;
using MoMoney.Presentation.Winforms.Resources;
using WeifenLuo.WinFormsUI.Docking;
product/Presentation/Views/IApplicationWindow.cs
@@ -1,7 +1,6 @@
using System.Windows.Forms;
-using MoMoney.Presentation.Views.Core;
-namespace MoMoney.Presentation.Views.core
+namespace MoMoney.Presentation.Views
{
public interface IApplicationWindow : IView
{
product/Presentation/Views/ICheckForUpdatesView.cs
@@ -1,10 +1,9 @@
using Gorilla.Commons.Utility;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.updates;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
-namespace MoMoney.Presentation.Views.updates
+namespace MoMoney.Presentation.Views
{
public interface ICheckForUpdatesView : IView<ICheckForUpdatesPresenter>, ICallback<ApplicationVersion>
{
product/Presentation/Views/ICommandDialog.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Windows.Forms
+namespace MoMoney.Presentation.Views
{
public interface ICommandDialog<Command> where Command : ICommand
{
product/Presentation/Views/IDialogLauncher.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Windows.Forms
+namespace MoMoney.Presentation.Views
{
public interface IDialogLauncher
{
product/Presentation/Views/IDockedContentView.cs
@@ -1,6 +1,6 @@
using WeifenLuo.WinFormsUI.Docking;
-namespace MoMoney.Presentation.Views.Core
+namespace MoMoney.Presentation.Views
{
public interface IDockedContentView : IDockContent, IView
{
product/Presentation/Views/IGettingStartedView.cs
@@ -1,7 +1,6 @@
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface IGettingStartedView : IDockedContentView,
IView<IGettingStartedPresenter>
product/Presentation/Views/ILogFileView.cs
@@ -1,7 +1,6 @@
using Gorilla.Commons.Utility.Core;
-using MoMoney.Presentation.Views.Core;
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface ILogFileView : IDockedContentView, ICallback<string>
{
product/Presentation/Views/IMainMenuView.cs
@@ -1,5 +1,4 @@
-using MoMoney.Presentation.Presenters.Navigation;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/INotificationIconView.cs
@@ -1,7 +1,7 @@
using System;
using MoMoney.Presentation.Winforms.Resources;
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface INotificationIconView : IDisposable
{
product/Presentation/Views/IRegionManager.cs
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface IRegionManager
{
product/Presentation/Views/IReportViewer.cs
@@ -1,5 +1,4 @@
using MoMoney.Presentation.Model.reporting;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ISaveChangesView.cs
@@ -1,7 +1,6 @@
-using MoMoney.Presentation.Model.Menu.File.Commands;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Model.Menu.File;
-namespace MoMoney.Presentation.Views.dialogs
+namespace MoMoney.Presentation.Views
{
public interface ISaveChangesView : IView<ISaveChangesPresenter>
{
product/Presentation/Views/ISelectFileToOpenDialog.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-namespace MoMoney.Presentation.Views.dialogs
+namespace MoMoney.Presentation.Views
{
public interface ISelectFileToOpenDialog
{
product/Presentation/Views/ISelectFileToSaveToDialog.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-namespace MoMoney.Presentation.Views.dialogs
+namespace MoMoney.Presentation.Views
{
public interface ISelectFileToSaveToDialog
{
product/Presentation/Views/IShell.cs
@@ -1,8 +1,6 @@
using System.ComponentModel;
using System.Windows.Forms;
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Views.Core;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Presenters;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ISplashScreenView.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Views.Startup
+namespace MoMoney.Presentation.Views
{
public interface ISplashScreenView
{
product/Presentation/Views/IStatusBarView.cs
@@ -1,5 +1,5 @@
-using Gorilla.Commons.Infrastructure.Threading;
using MoMoney.Presentation.Winforms.Resources;
+using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ITaskTrayMessageView.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface ITaskTrayMessageView
{
product/Presentation/Views/IUnhandledErrorView.cs
@@ -1,8 +1,7 @@
using System;
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
-namespace MoMoney.Presentation.Views.Shell
+namespace MoMoney.Presentation.Views
{
public interface IUnhandledErrorView : IView<IUnhandledErrorPresenter>
{
product/Presentation/Views/IView.cs
@@ -2,7 +2,7 @@ using System;
using System.ComponentModel;
using MoMoney.Presentation.Core;
-namespace MoMoney.Presentation.Views.Core
+namespace MoMoney.Presentation.Views
{
public interface IView : IWindowEvents, ISynchronizeInvoke, IDisposable
{
product/Presentation/Views/IViewAllBills.cs
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.billing;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/IViewIncomeHistory.cs
@@ -2,7 +2,6 @@ using System.Collections.Generic;
using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/IWindowEvents.cs
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
-using MoMoney.Presentation.Views.Core;
namespace MoMoney.Presentation.Views
{
product/Presentation/Winforms/Databinding/DateTimePropertyBindingSpecs.cs
@@ -9,7 +9,7 @@ namespace MoMoney.Presentation.Winforms.Databinding
public class when_a_new_date_is_selected_by_a_date_time_picker_that_is_bound_to_a_property : concerns
{
it should_update_the_value_of_the_property =
- () => Assertions.should_be_equal_to(thing_to_bind_to.birth_day, november_nineteenth);
+ () => thing_to_bind_to.birth_day.should_be_equal_to(november_nineteenth);
context c = () =>
{
product/Presentation/Winforms/Helpers/BindableTextBoxExtensionsSpecs.cs
@@ -12,7 +12,7 @@ namespace MoMoney.Presentation.Winforms.Helpers
[Concern(typeof (BindableTextBoxExtensions))]
public class when_binding_a_text_control_to_a_command : concerns
{
- it should_run_each_command_when_the_text_changes_in_the_text_control = () => command.was_told_to<ITextBoxCommand<string>>(x => x.run(result));
+ it should_run_each_command_when_the_text_changes_in_the_text_control = () => command.was_told_to(x => x.run(result));
context c = () =>
{
product/Presentation/Winforms/Helpers/BindableTextBoxSpecs.cs
@@ -1,7 +1,6 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
namespace MoMoney.Presentation.Winforms.Helpers
{
product/Presentation/Winforms/Helpers/EventTriggerSpecs.cs
@@ -11,8 +11,8 @@ namespace MoMoney.Presentation.Winforms.Helpers
it should_correctly_call_that_method =
() =>
{
- Assertions.should_be_true(control.called_on_key_press);
- Assertions.should_be_false(control.called_on_enter);
+ control.called_on_key_press.should_be_true();
+ control.called_on_enter.should_be_false();
};
context c = () => { control = new TestControl(); };
product/Presentation/Winforms/Views/AboutTheApplicationView.cs
@@ -1,7 +1,7 @@
using System;
using System.Reflection;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Views.Menu;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/AddBillPaymentView.cs
@@ -2,9 +2,8 @@ using System;
using System.Collections.Generic;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.billing;
-using MoMoney.Presentation.Views.billing;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Presenters;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Krypton;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/AddCompanyView.cs
@@ -6,7 +6,6 @@ using Gorilla.Commons.Utility.Extensions;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
using MoMoney.Presentation.Winforms.Databinding;
using MoMoney.Presentation.Winforms.Resources;
@@ -35,7 +34,7 @@ namespace MoMoney.Presentation.Winforms.Views
public void attach_to(IAddCompanyPresenter presenter)
{
- Create.bind_to(ux_company_name, dto, x => x.company_name);
+ ux_company_name.bind_to(dto, x => x.company_name);
submit_button = x => presenter.submit(dto);
}
product/Presentation/Winforms/Views/AddNewIncomeView.cs
@@ -4,7 +4,6 @@ using Gorilla.Commons.Utility.Extensions;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Krypton;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/ApplicationDockedWindow.cs
@@ -4,7 +4,6 @@ using System.Linq;
using System.Windows.Forms;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
using WeifenLuo.WinFormsUI.Docking;
product/Presentation/Winforms/Views/ApplicationShell.cs
@@ -1,12 +1,11 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Windows.Forms;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Presenters.Shell;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
using MoMoney.Presentation.Winforms.Helpers;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/ApplicationShellSpecs.cs
@@ -1,7 +1,7 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Presenters.Shell;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
product/Presentation/Winforms/Views/ApplicationWindow.cs
@@ -1,8 +1,7 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
-using MoMoney.Presentation.Views.core;
-using MoMoney.Presentation.Views.Core;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/CheckForUpdatesView.cs
@@ -3,10 +3,8 @@ using System.Reflection;
using System.Windows.Forms;
using Gorilla.Commons.Utility;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.updates;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Core;
-using MoMoney.Presentation.Views.updates;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/LogFileView.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/MainMenuView.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Presenters.Navigation;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/NotificationIconView.cs
@@ -4,7 +4,7 @@ using MoMoney.Presentation.Model.Menu;
using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Menu.Help;
using MoMoney.Presentation.Model.Menu.window;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MenuItem=System.Windows.Forms.MenuItem;
product/Presentation/Winforms/Views/SaveChangesView.cs
@@ -1,9 +1,8 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
-using MoMoney.Presentation.Model.Menu.File.Commands;
-using MoMoney.Presentation.Views.Core;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Model.Menu.File;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/SaveChangesViewSpecs.cs
@@ -1,7 +1,7 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Model.Menu.File.Commands;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Winforms.Helpers;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/SelectFileToOpenDialog.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Winforms.Views
{
product/Presentation/Winforms/Views/SelectFileToSaveToDialog.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.Presentation.Views.dialogs;
+using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Winforms.Views
{
product/Presentation/Winforms/Views/SplashScreenView.cs
@@ -1,6 +1,6 @@
using System;
using System.Windows.Forms;
-using MoMoney.Presentation.Views.Startup;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/StatusBarView.cs
@@ -1,6 +1,5 @@
using System.Windows.Forms;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Shell;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/TaskTrayMessage.cs
@@ -1,5 +1,5 @@
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Winforms.Views
{
product/Presentation/Winforms/Views/TitleBar.cs
@@ -1,6 +1,5 @@
using System.Windows.Forms;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.Shell;
namespace MoMoney.Presentation.Winforms.Views
{
product/Presentation/Winforms/Views/UnhandledErrorView.cs
@@ -1,8 +1,7 @@
-using System;
+using System;
using System.Windows.Forms;
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Views.Core;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Presenters;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/ViewAllBills.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters.billing;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/WelcomeScreen.cs
@@ -1,6 +1,6 @@
-using MoMoney.Presentation.Model.Menu.File.Commands;
-using MoMoney.Presentation.Presenters.Shell;
-using MoMoney.Presentation.Views.Shell;
+using MoMoney.Presentation.Model.Menu.File;
+using MoMoney.Presentation.Presenters;
+using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Presentation.csproj
@@ -542,6 +542,10 @@
<Project>{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}</Project>
<Name>Service</Name>
</ProjectReference>
+ <ProjectReference Include="..\utility\utility.csproj">
+ <Project>{22DF610D-CBC8-4042-A470-ABF246C5DDD4}</Project>
+ <Name>utility</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
product/Service/Application/GetAllCompanysQuery.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.ComponentModel;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.Domain.Accounting;
@@ -8,6 +9,7 @@ using MoMoney.Service.Contracts.Application;
namespace MoMoney.Service.Application
{
+ [DisplayName("Loading all companies...")]
public class GetAllCompanysQuery : IGetAllCompanysQuery
{
readonly ICompanyRepository companys;
product/Service/Infrastructure/debugging/Launch.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Diagnostics;
+
+namespace MoMoney.Service.Infrastructure.debugging
+{
+ static public class Launch
+ {
+ static public void the_debugger()
+ {
+#if DEBUG
+ if (Debugger.IsAttached) Debugger.Break();
+ else Debugger.Launch();
+#endif
+ }
+
+ static public void the_debugger_if(Func<bool> condition)
+ {
+#if DEBUG
+ if (!condition()) return;
+
+ if (Debugger.IsAttached) Debugger.Break();
+ else Debugger.Launch();
+#endif
+ }
+ }
+}
\ No newline at end of file
product/Service/Infrastructure/Eventing/EventAggregatorSpecs.cs
@@ -19,7 +19,7 @@ namespace MoMoney.Service.Infrastructure.Eventing
{
it should_notify_all_subscribers_of_the_event = () =>
{
- first_subscriber.was_told_to<IEventSubscriber<TestEvent>>(x => x.notify(message));
+ first_subscriber.was_told_to(x => x.notify(message));
second_subscriber.was_told_to(x => x.notify(message));
};
product/Service/Infrastructure/Logging/LogFileTasks.cs
@@ -1,5 +1,6 @@
using System.IO;
using Gorilla.Commons.Infrastructure.Reflection;
+using MoMoney.Service.Contracts.Infrastructure.Logging;
namespace MoMoney.Service.Infrastructure.Logging
{
product/Service/Infrastructure/Security/IsInRoleSpecs.cs
@@ -2,55 +2,62 @@ using System.Security.Principal;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Security;
-public class IsInRoleSpecs
+namespace MoMoney.Service.Infrastructure.Security
{
-}
-
-public class when_checking_if_a_principal_belongs_to_a_role :
- concerns_for<ISpecification<IPrincipal>, IsInRole>
-{
- static protected readonly Role administrator_role = new Role("administrators");
-
- public override ISpecification<IPrincipal> create_sut()
+ public class IsInRoleSpecs
{
- return new IsInRole(administrator_role);
+ public class when_checking_if_a_principal_belongs_to_a_role :
+ concerns_for<ISpecification<IPrincipal>, IsInRole>
+ {
+ static protected readonly Role administrator_role = new Role("administrators");
+
+ public override ISpecification<IPrincipal> create_sut()
+ {
+ return new IsInRole(administrator_role);
+ }
+ }
+
+ public class when_not_in_one_of_the_roles : when_checking_if_a_principal_belongs_to_a_role
+ {
+ context c = () =>
+ {
+ principal = the_dependency<IPrincipal>();
+ when_the(principal)
+ .is_told_to(x => x.IsInRole(administrator_role))
+ .it_will_return(false);
+ };
+
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(principal);
+ };
+
+ it should_return_false = () => result.should_be_false();
+
+ static bool result;
+ static IPrincipal principal;
+ }
+
+ public class when_in_one_of_the_roles : when_checking_if_a_principal_belongs_to_a_role
+ {
+ context c = () =>
+ {
+ principal = the_dependency<IPrincipal>();
+ when_the(principal)
+ .is_told_to(x => x.IsInRole(administrator_role))
+ .it_will_return(true);
+ };
+
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(principal);
+ };
+
+ it should_return_true = () => result.should_be_true();
+
+ static bool result;
+ static IPrincipal principal;
+ }
}
-}
-
-public class when_not_in_one_of_the_roles : when_checking_if_a_principal_belongs_to_a_role
-{
- context c = () =>
- {
- principal = the_dependency<IPrincipal>();
- when_the(principal)
- .is_told_to(x => x.IsInRole(administrator_role))
- .it_will_return(false);
- };
-
- because b = () => { result = sut.is_satisfied_by(principal); };
-
- it should_return_false = () => result.should_be_false();
-
- static bool result;
- static IPrincipal principal;
-}
-
-public class when_in_one_of_the_roles : when_checking_if_a_principal_belongs_to_a_role
-{
- context c = () =>
- {
- principal = the_dependency<IPrincipal>();
- when_the(principal)
- .is_told_to(x => x.IsInRole(administrator_role))
- .it_will_return(true);
- };
-
- because b = () => { result = sut.is_satisfied_by(principal); };
-
- it should_return_true = () => result.should_be_true();
-
- static bool result;
- static IPrincipal principal;
}
\ No newline at end of file
product/Service/Infrastructure/Threading/BackgroundThread.cs
@@ -1,6 +1,6 @@
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface IBackgroundThread : IDisposableCommand
{
product/Service/Infrastructure/Threading/BackgroundThreadFactory.cs
@@ -3,7 +3,7 @@ using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface IBackgroundThreadFactory
{
product/Service/Infrastructure/Threading/BackgroundThreadFactorySpecs.cs
@@ -3,7 +3,7 @@ using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Testing;
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (BackgroundThreadFactory))]
public abstract class behaves_like_a_background_thread_factory : concerns_for<IBackgroundThreadFactory, BackgroundThreadFactory>
product/Service/Infrastructure/Threading/BackgroundThreadSpecs.cs
@@ -3,16 +3,16 @@ using Gorilla.Commons.Testing;
using MoMoney.Utility.Core;
using Rhino.Mocks;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (BackgroundThread))]
public abstract class behaves_like_a_background_thread : concerns_for<IBackgroundThread, BackgroundThread>
{
context c = () =>
- {
- command_to_execute = the_dependency<IDisposableCommand>();
- worker_thread = the_dependency<IWorkerThread>();
- };
+ {
+ command_to_execute = the_dependency<IDisposableCommand>();
+ worker_thread = the_dependency<IWorkerThread>();
+ };
protected static IDisposableCommand command_to_execute;
protected static IWorkerThread worker_thread;
@@ -26,10 +26,10 @@ namespace Gorilla.Commons.Infrastructure.Threading
it should_start_the_worker_thread_asynchronously = () => worker_thread.was_told_to(t => t.begin());
because b = () =>
- {
- sut.run();
- worker_thread.Raise(t => t.DoWork += null, null, null);
- };
+ {
+ sut.run();
+ worker_thread.Raise(t => t.DoWork += null, null, null);
+ };
}
[Concern(typeof (BackgroundThread))]
product/Service/Infrastructure/Threading/CommandProcessorSpecs.cs
@@ -1,9 +1,8 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Threading;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (CommandProcessor))]
public abstract class behaves_like_a_command_processor : concerns_for<ICommandProcessor, CommandProcessor>
@@ -18,17 +17,17 @@ namespace Gorilla.Commons.Infrastructure.Threading
it should_run_the_second_command_in_the_queue = () => second_command.was_told_to(f => f.run());
context c = () =>
- {
- first_command = an<ICommand>();
- second_command = an<ICommand>();
- };
+ {
+ first_command = an<ICommand>();
+ second_command = an<ICommand>();
+ };
because b = () =>
- {
- sut.add(first_command);
- sut.add(second_command);
- sut.run();
- };
+ {
+ sut.add(first_command);
+ sut.add(second_command);
+ sut.run();
+ };
static ICommand first_command;
static ICommand second_command;
@@ -43,11 +42,11 @@ namespace Gorilla.Commons.Infrastructure.Threading
context c = () => { first_command = an<ICommand>(); };
because b = () =>
- {
- sut.add(first_command);
- sut.run();
- sut.run();
- };
+ {
+ sut.add(first_command);
+ sut.run();
+ sut.run();
+ };
static ICommand first_command;
}
product/Service/Infrastructure/Threading/IntervalTimer.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Timers;
-using Gorilla.Commons.Infrastructure.Threading;
namespace MoMoney.Service.Infrastructure.Threading
{
product/Service/Infrastructure/Threading/IntervalTimerSpecs.cs
@@ -2,10 +2,9 @@ using System;
using System.Timers;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Service.Infrastructure.Threading;
using Rhino.Mocks;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (IntervalTimer))]
public abstract class behaves_like_an_interval_timer : concerns_for<ITimer, IntervalTimer>
@@ -26,12 +25,12 @@ namespace Gorilla.Commons.Infrastructure.Threading
it should_start_the_timer = () => timer.was_told_to(t => t.Start());
context c = () =>
- {
- client = an<ITimerClient>();
- timer = dependency<Timer>();
+ {
+ client = an<ITimerClient>();
+ timer = dependency<Timer>();
- factory.is_told_to(f => f.create_for(new TimeSpan(0, 10, 0))).it_will_return(timer);
- };
+ factory.is_told_to(f => f.create_for(new TimeSpan(0, 10, 0))).it_will_return(timer);
+ };
because b = () => sut.start_notifying(client, new TimeSpan(0, 10, 0));
}
@@ -40,28 +39,28 @@ namespace Gorilla.Commons.Infrastructure.Threading
public class when_starting_a_timer_for_an_existing_client : behaves_like_an_interval_timer
{
it should_stop_the_previously_started_timer = () =>
- {
- first_timer.was_told_to(t => t.Stop());
- first_timer.was_told_to(t => t.Dispose());
- };
+ {
+ first_timer.was_told_to(t => t.Stop());
+ first_timer.was_told_to(t => t.Dispose());
+ };
it should_start_a_new_timer = () => second_timer.was_told_to(t => t.Start());
context c = () =>
- {
- client = an<ITimerClient>();
- first_timer = dependency<Timer>();
- second_timer = dependency<Timer>();
+ {
+ client = an<ITimerClient>();
+ first_timer = dependency<Timer>();
+ second_timer = dependency<Timer>();
- factory.is_told_to(f => f.create_for(new TimeSpan(0, 1, 1))).it_will_return(first_timer);
- factory.is_told_to(f => f.create_for(new TimeSpan(0, 2, 2))).it_will_return(second_timer);
- };
+ factory.is_told_to(f => f.create_for(new TimeSpan(0, 1, 1))).it_will_return(first_timer);
+ factory.is_told_to(f => f.create_for(new TimeSpan(0, 2, 2))).it_will_return(second_timer);
+ };
because b = () =>
- {
- sut.start_notifying(client, new TimeSpan(0, 1, 1));
- sut.start_notifying(client, new TimeSpan(0, 2, 2));
- };
+ {
+ sut.start_notifying(client, new TimeSpan(0, 1, 1));
+ sut.start_notifying(client, new TimeSpan(0, 2, 2));
+ };
static ITimerClient client;
static Timer first_timer;
@@ -77,17 +76,17 @@ namespace Gorilla.Commons.Infrastructure.Threading
static Timer timer;
context c = () =>
- {
- client = an<ITimerClient>();
- timer = dependency<Timer>();
- factory.is_told_to(f => f.create_for(Arg<TimeSpan>.Is.Anything)).it_will_return(timer);
- };
+ {
+ client = an<ITimerClient>();
+ timer = dependency<Timer>();
+ factory.is_told_to(f => f.create_for(Arg<TimeSpan>.Is.Anything)).it_will_return(timer);
+ };
because b = () =>
- {
- sut.start_notifying(client, new TimeSpan(0, 10, 0));
- timer.Raise(t => t.Elapsed += null, timer, null);
- };
+ {
+ sut.start_notifying(client, new TimeSpan(0, 10, 0));
+ timer.Raise(t => t.Elapsed += null, timer, null);
+ };
}
[Concern(typeof (IntervalTimer))]
@@ -101,19 +100,19 @@ namespace Gorilla.Commons.Infrastructure.Threading
it should_dispose_the_timer_that_was_started_for_the_client = () => timer.was_told_to(t => t.Dispose());
context c = () =>
- {
- client = an<ITimerClient>();
- timer = dependency<Timer>();
+ {
+ client = an<ITimerClient>();
+ timer = dependency<Timer>();
- when_the(factory).is_told_to(t => t.create_for(Arg<TimeSpan>.Is.Anything)).it_will_return(
- timer);
- };
+ when_the(factory).is_told_to(t => t.create_for(Arg<TimeSpan>.Is.Anything)).it_will_return(
+ timer);
+ };
because b = () =>
- {
- sut.start_notifying(client, new TimeSpan(0, 0, 1));
- sut.stop_notifying(client);
- };
+ {
+ sut.start_notifying(client, new TimeSpan(0, 0, 1));
+ sut.stop_notifying(client);
+ };
}
[Concern(typeof (IntervalTimer))]
product/Service/Infrastructure/Threading/ITimerClient.cs
@@ -1,4 +1,4 @@
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface ITimerClient
{
product/Service/Infrastructure/Threading/IWorkerThread.cs
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface IWorkerThread : IDisposable
{
product/Service/Infrastructure/Threading/RaiseEventInterceptor.cs
@@ -1,7 +1,7 @@
using Castle.Core.Interceptor;
using MoMoney.Service.Infrastructure.Eventing;
-namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface IRaiseEventInterceptor<Event> : IInterceptor where Event : IEvent, new()
{
product/Service/Infrastructure/Threading/RunOnBackgroundThreadInterceptor.cs
@@ -1,8 +1,7 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Infrastructure.Threading;
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
+namespace MoMoney.Service.Infrastructure.Threading
{
public class RunOnBackgroundThreadInterceptor<CommandToExecute> : IInterceptor
where CommandToExecute : IDisposableCommand
product/Service/Infrastructure/Threading/RunOnBackgroundThreadInterceptorSpecs.cs
@@ -1,10 +1,9 @@
using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Testing;
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (RunOnBackgroundThreadInterceptor<>))]
public abstract class behaves_like_background_thread_interceptor :
@@ -20,13 +19,13 @@ namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
behaves_like_background_thread_interceptor
{
context c = () =>
- {
- invocation = an<IInvocation>();
- background_thread = an<IBackgroundThread>();
- thread_factory
- .is_told_to(f => f.create_for<IDisposableCommand>())
- .it_will_return(background_thread);
- };
+ {
+ invocation = an<IInvocation>();
+ background_thread = an<IBackgroundThread>();
+ thread_factory
+ .is_told_to(f => f.create_for<IDisposableCommand>())
+ .it_will_return(background_thread);
+ };
because b = () => sut.Intercept(invocation);
product/Service/Infrastructure/Threading/RunOnUIThread.cs
@@ -1,8 +1,8 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Infrastructure.Threading;
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
+namespace MoMoney.Service.Infrastructure.Threading
{
public class RunOnUIThread : IInterceptor
{
product/Service/Infrastructure/Threading/SynchronizationContextFactory.cs
@@ -2,7 +2,7 @@ using System.Threading;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface ISynchronizationContextFactory : IFactory<ISynchronizationContext>
{
product/Service/Infrastructure/Threading/SynchronizedCommand.cs
@@ -2,7 +2,7 @@ using System;
using System.Threading;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface ISynchronizedCommand : IParameterizedCommand<Action>, IParameterizedCommand<ICommand>
{
product/Service/Infrastructure/Threading/SynchronizedContext.cs
@@ -1,7 +1,7 @@
using System.Threading;
using Gorilla.Commons.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface ISynchronizationContext : IParameterizedCommand<ICommand>
{
product/Service/Infrastructure/Threading/Synchronizer.cs
@@ -5,7 +5,7 @@ using System.Diagnostics;
using System.Security.Permissions;
using System.Threading;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[SecurityPermission(SecurityAction.Demand, ControlThread = true)]
public class Synchronizer : ISynchronizeInvoke, IDisposable
@@ -14,7 +14,7 @@ namespace Gorilla.Commons.Infrastructure.Threading
public Synchronizer()
{
- worker_thread = new WorkerThread(this);
+ worker_thread = new WorkerThread();
}
public bool InvokeRequired
@@ -55,12 +55,10 @@ namespace Gorilla.Commons.Infrastructure.Threading
bool end_loop;
readonly Mutex end_loop_mutex;
readonly AutoResetEvent item_added;
- Synchronizer synchronizer;
readonly Queue work_item_queue;
- internal WorkerThread(Synchronizer synchronizer)
+ internal WorkerThread()
{
- this.synchronizer = synchronizer;
end_loop = false;
thread = null;
end_loop_mutex = new Mutex();
@@ -88,7 +86,7 @@ namespace Gorilla.Commons.Infrastructure.Threading
}
get
{
- var result = false;
+ bool result;
end_loop_mutex.WaitOne();
result = end_loop;
end_loop_mutex.ReleaseMutex();
product/Service/Infrastructure/Threading/ThreadingExtensions.cs
@@ -1,6 +1,6 @@
using MoMoney.Utility.Core;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public static class ThreadingExtensions
{
product/Service/Infrastructure/Threading/TimerFactory.cs
@@ -1,7 +1,7 @@
using System;
using System.Timers;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public interface ITimerFactory
{
product/Service/Infrastructure/Threading/TimerFactorySpecs.cs
@@ -3,7 +3,7 @@ using System.Timers;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Concern(typeof (TimerFactory))]
public abstract class behaves_like_a_timer_factory : concerns_for<ITimerFactory, TimerFactory>
@@ -31,11 +31,11 @@ namespace Gorilla.Commons.Infrastructure.Threading
() => result.Interval.should_be_equal_to(milliseconds);
because b = () =>
- {
- var timer_interval = new TimeSpan(50);
- milliseconds = 50;
- result = sut.create_for(timer_interval);
- };
+ {
+ var timer_interval = new TimeSpan(50);
+ milliseconds = 50;
+ result = sut.create_for(timer_interval);
+ };
static Timer result;
static double milliseconds;
product/Service/Infrastructure/Threading/WorkerThread.cs
@@ -2,7 +2,7 @@ using System;
using System.ComponentModel;
using Gorilla.Commons.Infrastructure.Logging;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
public class WorkerThread : Component, IWorkerThread
{
product/Service/Infrastructure/Threading/WorkItem.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading;
-namespace Gorilla.Commons.Infrastructure.Threading
+namespace MoMoney.Service.Infrastructure.Threading
{
[Serializable]
internal class WorkItem : IAsyncResult
product/Service/Infrastructure/Transactions/EmptyUnitOfWork.cs
@@ -1,4 +1,5 @@
using Gorilla.Commons.Infrastructure.Logging;
+using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Transactions/UnitOfWork.cs
@@ -1,4 +1,5 @@
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
+using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Transactions/UnitOfWorkFactory.cs
@@ -1,4 +1,4 @@
-using Gorilla.Commons.Infrastructure.Transactions;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
product/Service/Infrastructure/Transactions/UnitOfWorkFactorySpecs.cs
@@ -1,6 +1,6 @@
using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Testing;
+using MoMoney.DataAccess.Transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
product/Service/Infrastructure/Transactions/UnitOfWorkSpecs.cs
@@ -1,6 +1,7 @@
using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Testing;
+using MoMoney.DataAccess.Transactions;
+using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Updating/CancelUpdate.cs
@@ -1,4 +1,4 @@
-using MoMoney.Tasks.infrastructure.updating;
+using MoMoney.Service.Contracts.Infrastructure.Updating;
namespace MoMoney.Service.Infrastructure.Updating
{
product/Service/Infrastructure/Updating/CancelUpdateSpecs.cs
@@ -1,8 +1,8 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Service.Infrastructure.Updating;
+using MoMoney.Service.Contracts.Infrastructure.Updating;
-namespace MoMoney.Tasks.infrastructure.updating
+namespace MoMoney.Service.Infrastructure.Updating
{
public class CancelUpdateSpecs
{
product/Service/Infrastructure/Updating/CurrentDeployment.cs
@@ -1,9 +1,8 @@
using System;
using System.ComponentModel;
using System.Deployment.Application;
-using MoMoney.Service.Infrastructure.Updating;
-namespace MoMoney.Tasks.infrastructure.updating
+namespace MoMoney.Service.Infrastructure.Updating
{
public class CurrentDeployment : IDeployment
{
product/Service/Infrastructure/Updating/DownloadTheLatestVersion.cs
@@ -1,5 +1,6 @@
using Gorilla.Commons.Utility;
using Gorilla.Commons.Utility.Core;
+using MoMoney.Service.Contracts.Infrastructure.Updating;
namespace MoMoney.Service.Infrastructure.Updating
{
product/Service/Infrastructure/Updating/NullDeployment.cs
@@ -2,9 +2,8 @@ using System;
using System.ComponentModel;
using System.Deployment.Application;
using System.Threading;
-using MoMoney.Service.Infrastructure.Updating;
-namespace MoMoney.Tasks.infrastructure.updating
+namespace MoMoney.Service.Infrastructure.Updating
{
public class NullDeployment : IDeployment
{
product/Service/Service.csproj
@@ -98,6 +98,7 @@
<Compile Include="Application\IEventLog.cs" />
<Compile Include="Application\RegisterNewCompanyCommand.cs" />
<Compile Include="Application\SaveNewBillCommand.cs" />
+ <Compile Include="Infrastructure\debugging\Launch.cs" />
<Compile Include="Infrastructure\Eventing\EventAggregator.cs" />
<Compile Include="Infrastructure\Eventing\EventAggregatorSpecs.cs" />
<Compile Include="Infrastructure\Eventing\IEvent.cs" />
product/Service.Contracts/Infrastructure/Logging/ILogFileTasks.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Service.Infrastructure.Logging
+namespace MoMoney.Service.Contracts.Infrastructure.Logging
{
public interface ILogFileTasks
{
product/Service.Contracts/Infrastructure/Transactions/IUnitOfWork.cs
@@ -1,6 +1,6 @@
using System;
-namespace MoMoney.Service.Infrastructure.Transactions
+namespace MoMoney.Service.Contracts.Infrastructure.Transactions
{
public interface IUnitOfWork : IDisposable
{
product/Service.Contracts/Infrastructure/Transactions/IUnitOfWorkFactory.cs
@@ -1,5 +1,4 @@
using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Transactions;
namespace MoMoney.Service.Contracts.Infrastructure.Transactions
{
product/Service.Contracts/Infrastructure/Updating/ICancelUpdate.cs
@@ -1,6 +1,6 @@
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Tasks.infrastructure.updating
+namespace MoMoney.Service.Contracts.Infrastructure.Updating
{
public interface ICancelUpdate : ICommand
{
product/Service.Contracts/Infrastructure/Updating/IDownloadTheLatestVersion.cs
@@ -1,7 +1,7 @@
using Gorilla.Commons.Utility;
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Service.Infrastructure.Updating
+namespace MoMoney.Service.Contracts.Infrastructure.Updating
{
public interface IDownloadTheLatestVersion : ICallbackCommand<Percent>
{
product/Service.Contracts/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
product/utility/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("utility")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("utility")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4214063d-bc70-4ed8-a536-a90c8a65741e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
product/utility/AttributeExtensions.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Reflection;
+
+namespace momoney.utility
+{
+ static public class AttributeExtensions
+ {
+ static public bool is_decorated_with<T>(this object item) where T : Attribute
+ {
+ return item.GetType().is_decorated_with<T>();
+ }
+
+ static public bool is_decorated_with<T>(this ICustomAttributeProvider item) where T : Attribute
+ {
+ return item.IsDefined(typeof (T), true);
+ }
+
+ static public T attribute<T>(this object item) where T : Attribute
+ {
+ return item.GetType().attribute<T>();
+ }
+
+ static public T attribute<T>(this ICustomAttributeProvider item) where T : Attribute
+ {
+ return (T) item.GetCustomAttributes(typeof (T), true)[0];
+ }
+ }
+}
\ No newline at end of file
product/utility/utility.csproj
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{22DF610D-CBC8-4042-A470-ABF246C5DDD4}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>momoney.utility</RootNamespace>
+ <AssemblyName>momoney.utility</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AttributeExtensions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
solution.sln
@@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Presentation", "product\Pre
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service.Contracts", "product\Service.Contracts\Service.Contracts.csproj", "{41D2B68B-031B-44FF-BAC5-7752D9E29F94}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utility", "product\utility\utility.csproj", "{22DF610D-CBC8-4042-A470-ABF246C5DDD4}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -55,6 +57,10 @@ Global
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Release|Any CPU.Build.0 = Release|Any CPU
+ {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE