Index: Ringtoets/Common/src/Ringtoets.Common.Data/Comment.cs
===================================================================
diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r7ccd8feadb7362bad296fb6864c55d8cfa0992ad
--- Ringtoets/Common/src/Ringtoets.Common.Data/Comment.cs (.../Comment.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Comment.cs (.../Comment.cs) (revision 7ccd8feadb7362bad296fb6864c55d8cfa0992ad)
@@ -19,16 +19,23 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
+
namespace Ringtoets.Common.Data
{
///
/// This class represents a comment on some subject.
///
- public class Comment
+ public class Comment : ICloneable
{
///
/// Gets or sets the comment body.
///
public string Body { get; set; }
+
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/CommentTest.cs
===================================================================
diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r7ccd8feadb7362bad296fb6864c55d8cfa0992ad
--- Ringtoets/Common/test/Ringtoets.Common.Data.Test/CommentTest.cs (.../CommentTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/CommentTest.cs (.../CommentTest.cs) (revision 7ccd8feadb7362bad296fb6864c55d8cfa0992ad)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using NUnit.Framework;
namespace Ringtoets.Common.Data.Test
@@ -33,7 +34,23 @@
var comment = new Comment();
// Assert
+ Assert.IsInstanceOf(comment);
Assert.IsNull(comment.Body);
}
+
+ [Test]
+ public void Clone_ReturnExpectedClone()
+ {
+ // Setup
+ var comment = new Comment();
+
+ // Call
+ var clone = comment.Clone() as Comment;
+
+ // Assert
+ Assert.IsNotNull(clone);
+ Assert.AreNotSame(comment, clone);
+ Assert.AreEqual(comment.Body, clone.Body);
+ }
}
}
\ No newline at end of file