Index: Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj
===================================================================
diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -r33bb120fbaf0452934a7762b24d675201325e774
--- Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51)
+++ Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 33bb120fbaf0452934a7762b24d675201325e774)
@@ -111,6 +111,7 @@
Component
+
UserControl
Index: Core/Common/src/Core.Common.Controls/PresentationObjects/ObservableWrappedObjectContextBase.cs
===================================================================
diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -r33bb120fbaf0452934a7762b24d675201325e774
--- Core/Common/src/Core.Common.Controls/PresentationObjects/ObservableWrappedObjectContextBase.cs (.../ObservableWrappedObjectContextBase.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51)
+++ Core/Common/src/Core.Common.Controls/PresentationObjects/ObservableWrappedObjectContextBase.cs (.../ObservableWrappedObjectContextBase.cs) (revision 33bb120fbaf0452934a7762b24d675201325e774)
@@ -20,73 +20,25 @@
// All rights reserved.
using System;
-
using Core.Common.Base;
namespace Core.Common.Controls.PresentationObjects
{
///
- /// This abstract class provides common boilerplate implementations for presentation
- /// objects based on a single object that needs additional dependencies or behavior
- /// for the UI layer of the application.
+ /// This abstract class provides common boilerplate implementations for observable
+ /// presentation objects based on a single observable object that needs additional
+ /// dependencies or behavior for the UI layer of the application.
///
- /// The object type of the wrapped instance.
- public abstract class ObservableWrappedObjectContextBase : IObservable, IEquatable> where T : IObservable
+ /// The observable object type of the wrapped instance.
+ public abstract class ObservableWrappedObjectContextBase : WrappedObjectContextBase, IObservable where T : IObservable
{
///
/// Initializes a new instance of the class.
///
/// The wrapped data.
/// When is null.
- protected ObservableWrappedObjectContextBase(T wrappedData)
- {
- if (wrappedData == null)
- {
- throw new ArgumentNullException("wrappedData", "Wrapped data of context cannot be null.");
- }
- WrappedData = wrappedData;
- }
+ protected ObservableWrappedObjectContextBase(T wrappedData) : base(wrappedData) {}
- ///
- /// Gets the data wrapped in this presentation object.
- ///
- public T WrappedData { get; private set; }
-
- #region Equality members
-
- public bool Equals(ObservableWrappedObjectContextBase other)
- {
- if (ReferenceEquals(null, other))
- {
- return false;
- }
- if (ReferenceEquals(this, other))
- {
- return true;
- }
- return WrappedData.Equals(other.WrappedData);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
- return Equals(obj as ObservableWrappedObjectContextBase);
- }
-
- public override int GetHashCode()
- {
- return WrappedData.GetHashCode();
- }
-
- #endregion
-
#region IObservable implementation
public void Attach(IObserver observer)
Fisheye: Tag 658bc34e6a72d83b209bf9bdf45d1001ca135e51 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Controls/PresentationObjects/WrappedObjectContextBase.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj
===================================================================
diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -r33bb120fbaf0452934a7762b24d675201325e774
--- Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj (.../Core.Common.Controls.Test.csproj) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51)
+++ Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj (.../Core.Common.Controls.Test.csproj) (revision 33bb120fbaf0452934a7762b24d675201325e774)
@@ -60,6 +60,7 @@
+
True
Index: Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs
===================================================================
diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -r33bb120fbaf0452934a7762b24d675201325e774
--- Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs (.../ObservableWrappedObjectContextBaseTest.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51)
+++ Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs (.../ObservableWrappedObjectContextBaseTest.cs) (revision 33bb120fbaf0452934a7762b24d675201325e774)
@@ -20,13 +20,9 @@
// All rights reserved.
using System;
-
using Core.Common.Base;
using Core.Common.Controls.PresentationObjects;
-using Core.Common.TestUtil;
-
using NUnit.Framework;
-
using Rhino.Mocks;
namespace Core.Common.Controls.Test.PresentationObjects
@@ -47,152 +43,13 @@
// Assert
Assert.IsInstanceOf(context);
- Assert.IsInstanceOf>>(context);
+ Assert.IsInstanceOf>(context);
Assert.AreSame(sourceObject, context.WrappedData);
mocks.VerifyAll();
}
[Test]
- public void Constructor_InputArgumentIsNull_ThrowArgumentNullException()
- {
- // Call
- TestDelegate call = () => new SimpleObservableWrappedObjectContext(null);
-
- // Assert
- const string expectedMessage = "Wrapped data of context cannot be null.";
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage);
- }
-
- [Test]
- public void Equals_ToNull_ReturnFalse()
- {
- // Setup
- var mocks = new MockRepository();
- var sourceObject = mocks.Stub();
- mocks.ReplayAll();
-
- var context = new SimpleObservableWrappedObjectContext(sourceObject);
-
- // Call
- var isEqual = context.Equals(null);
-
- // Assert
- Assert.IsFalse(isEqual);
-
- mocks.VerifyAll();
- }
-
- [Test]
- public void Equals_ToOtherValueType_ReturnFalse()
- {
- // Setup
- var mocks = new MockRepository();
- var sourceObject = mocks.Stub();
- mocks.ReplayAll();
-
- var context1 = new SimpleObservableWrappedObjectContext(sourceObject);
- var context2 = new SimpleObservableWrappedObjectContext>(new ObservableList