diff --git a/NzbDrone.5.1.ReSharper b/NzbDrone.5.1.ReSharper
new file mode 100644
index 000000000..5792be25b
--- /dev/null
+++ b/NzbDrone.5.1.ReSharper
@@ -0,0 +1,70 @@
+
+
+
+
+ SOLUTION
+
+
+
+ - public
+ - protected
+ - internal
+ - private
+ - new
+ - abstract
+ - virtual
+ - override
+ - sealed
+ - static
+ - readonly
+ - extern
+ - unsafe
+ - volatile
+
+
+
+
+ $object$_On$event$
+ $event$Handler
+
+
+
+
+
+
+ $object$_On$event$
+ $event$Handler
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $object$_On$event$
+ $event$Handler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NzbDrone.Core.Test/AutoMoq/AutoMoqer.cs b/NzbDrone.Core.Test/AutoMoq/AutoMoqer.cs
index 2c59c52a2..8a00b36cf 100644
--- a/NzbDrone.Core.Test/AutoMoq/AutoMoqer.cs
+++ b/NzbDrone.Core.Test/AutoMoq/AutoMoqer.cs
@@ -14,9 +14,9 @@ namespace AutoMoq
{
public class AutoMoqer
{
+ internal Type ResolveType;
private IUnityContainer container;
private IDictionary registeredMocks;
- internal Type ResolveType = null;
public AutoMoqer()
{
@@ -30,7 +30,7 @@ namespace AutoMoq
public virtual T Resolve()
{
- ResolveType = typeof(T);
+ ResolveType = typeof (T);
var result = container.Resolve();
ResolveType = null;
return result;
@@ -67,47 +67,6 @@ namespace AutoMoq
SetMock(instance.GetType(), null);
}
- #region private methods
-
- private void SetupAutoMoqer(IUnityContainer container)
- {
- this.container = container;
- registeredMocks = new Dictionary();
-
- AddTheAutoMockingContainerExtensionToTheContainer(container);
- container.RegisterInstance(this);
- }
-
- private static void AddTheAutoMockingContainerExtensionToTheContainer(IUnityContainer container)
- {
- container.AddNewExtension();
- return;
- }
-
- private Mock TheRegisteredMockForThisType(Type type) where T : class
- {
- return (Mock)registeredMocks.Where(x => x.Key == type).First().Value;
- }
-
- private void CreateANewMockAndRegisterIt(Type type, MockBehavior behavior) where T : class
- {
- var mock = new Mock(behavior);
- container.RegisterInstance(mock.Object);
- SetMock(type, mock);
- }
-
- private bool GetMockHasNotBeenCalledForThisType(Type type)
- {
- return registeredMocks.ContainsKey(type) == false;
- }
-
- private static Type GetTheMockType() where T : class
- {
- return typeof(T);
- }
-
- #endregion
-
public ISetup Setup(Expression> expression) where T : class
{
return GetMock().Setup(expression);
@@ -147,5 +106,45 @@ namespace AutoMoq
}
}
+ #region private methods
+
+ private void SetupAutoMoqer(IUnityContainer container)
+ {
+ this.container = container;
+ registeredMocks = new Dictionary();
+
+ AddTheAutoMockingContainerExtensionToTheContainer(container);
+ container.RegisterInstance(this);
+ }
+
+ private static void AddTheAutoMockingContainerExtensionToTheContainer(IUnityContainer container)
+ {
+ container.AddNewExtension();
+ return;
+ }
+
+ private Mock TheRegisteredMockForThisType(Type type) where T : class
+ {
+ return (Mock) registeredMocks.Where(x => x.Key == type).First().Value;
+ }
+
+ private void CreateANewMockAndRegisterIt(Type type, MockBehavior behavior) where T : class
+ {
+ var mock = new Mock(behavior);
+ container.RegisterInstance(mock.Object);
+ SetMock(type, mock);
+ }
+
+ private bool GetMockHasNotBeenCalledForThisType(Type type)
+ {
+ return registeredMocks.ContainsKey(type) == false;
+ }
+
+ private static Type GetTheMockType() where T : class
+ {
+ return typeof (T);
+ }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core.Test/AutoMoq/AutoMoqerTest.cs b/NzbDrone.Core.Test/AutoMoq/AutoMoqerTest.cs
index 19fecff58..dacb0e36d 100644
--- a/NzbDrone.Core.Test/AutoMoq/AutoMoqerTest.cs
+++ b/NzbDrone.Core.Test/AutoMoq/AutoMoqerTest.cs
@@ -1,22 +1,7 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
using AutoMoq;
-using FizzWare.NBuilder;
-using Gallio.Framework;
using MbUnit.Framework;
-using MbUnit.Framework.ContractVerifiers;
using Moq;
-using Ninject;
-using Ninject.Moq;
-using NzbDrone.Core.Providers;
-using NzbDrone.Core.Repository;
-using NzbDrone.Core.Repository.Quality;
-using SubSonic.Repository;
-using TvdbLib.Data;
-using SubSonic.Extensions;
namespace NzbDrone.Core.Test
{
@@ -117,7 +102,7 @@ namespace NzbDrone.Core.Test
//Arrange
var mocker = new AutoMoqer();
- var constant = new VirtualDependency() { PropValue = Guid.NewGuid().ToString() };
+ var constant = new VirtualDependency {PropValue = Guid.NewGuid().ToString()};
mocker.SetConstant(constant);
@@ -127,7 +112,6 @@ namespace NzbDrone.Core.Test
//Assert
Assert.AreEqual(constant.PropValue, result);
}
-
}
public class ConcreteClass
@@ -138,24 +122,27 @@ namespace NzbDrone.Core.Test
}
}
- public class Dependency : IDependency { }
+ public class Dependency : IDependency
+ {
+ }
- public interface IDependency { }
+ public interface IDependency
+ {
+ }
public class ClassWithDependencies
{
- public IDependency Dependency { get; set; }
-
public ClassWithDependencies(IDependency dependency)
{
Dependency = dependency;
}
+
+ public IDependency Dependency { get; set; }
}
public class ClassWithVirtualDependencies
{
private readonly VirtualDependency _virtualDependency;
- public IDependency Dependency { get; set; }
public ClassWithVirtualDependencies(IDependency dependency, VirtualDependency virtualDependency)
{
@@ -163,6 +150,8 @@ namespace NzbDrone.Core.Test
Dependency = dependency;
}
+ public IDependency Dependency { get; set; }
+
public string CallVirtualChild()
{
return _virtualDependency.VirtualMethod();
@@ -178,19 +167,20 @@ namespace NzbDrone.Core.Test
{
private readonly IDependency _dependency;
- public string PropValue { get; set; }
-
- public VirtualDependency() { }
+ public VirtualDependency()
+ {
+ }
public VirtualDependency(IDependency dependency)
{
_dependency = dependency;
}
+ public string PropValue { get; set; }
+
public virtual string VirtualMethod()
{
return "hello";
}
}
-
-}
+}
\ No newline at end of file
diff --git a/NzbDrone.Core.Test/AutoMoq/Unity/AutoMockingBuilderStrategy.cs b/NzbDrone.Core.Test/AutoMoq/Unity/AutoMockingBuilderStrategy.cs
index d6dff8997..26297916e 100644
--- a/NzbDrone.Core.Test/AutoMoq/Unity/AutoMockingBuilderStrategy.cs
+++ b/NzbDrone.Core.Test/AutoMoq/Unity/AutoMockingBuilderStrategy.cs
@@ -10,9 +10,9 @@ namespace AutoMoq.Unity
{
internal class AutoMockingBuilderStrategy : BuilderStrategy
{
+ private readonly IUnityContainer container;
private readonly MockFactory mockFactory;
private readonly IEnumerable registeredTypes;
- private readonly IUnityContainer container;
public AutoMockingBuilderStrategy(IEnumerable registeredTypes, IUnityContainer container)
{
@@ -45,7 +45,7 @@ namespace AutoMoq.Unity
private static Type GetTheTypeFromTheBuilderContext(IBuilderContext context)
{
- return ((NamedTypeBuildKey)context.OriginalBuildKey).Type;
+ return (context.OriginalBuildKey).Type;
}
private bool TypeIsNotRegistered(Type type)
@@ -62,19 +62,19 @@ namespace AutoMoq.Unity
private Mock InvokeTheMockCreationMethod(MethodInfo createMethod)
{
- return (Mock)createMethod.Invoke(mockFactory, new object[] { new List