Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs =================================================================== diff -u -r5ef5e3e186036b4985798236624d86b2801b87d3 -r1e6d07e8cbd1c29a16b5addddb7205e717543729 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (.../CommentContextTest.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (.../CommentContextTest.cs) (revision 1e6d07e8cbd1c29a16b5addddb7205e717543729) @@ -1,6 +1,7 @@ using System; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Forms.PresentationObjects; @@ -14,26 +15,49 @@ { // Setup var mocks = new MockRepository(); + var commentMock = mocks.StrictMock(); var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - var context = new CommentContext(assessmentSectionMock); + var context = new CommentContext(commentMock, assessmentSectionMock); // Assert - Assert.AreSame(assessmentSectionMock, context.CommentContainer); + Assert.AreSame(commentMock, context.CommentContainer); + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); } [Test] - public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + public void Constructor_CommentContainerNull_ThrowsArgumentNullException() { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + + mocks.ReplayAll(); // Call - TestDelegate call = () => new CommentContext(null); + TestDelegate call = () => new CommentContext(null, assessmentSectionMock); // Assert var exception = Assert.Throws(call); Assert.AreEqual("commentContainer", exception.ParamName); } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var commentMock = mocks.StrictMock(); + + mocks.ReplayAll(); + // Call + TestDelegate call = () => new CommentContext(commentMock, null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } } } \ No newline at end of file