using System; using Core.Common.Controls.PresentationObjects; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms.PresentationObjects; namespace Ringtoets.Piping.Forms.Test.PresentationObjects { [TestFixture] public class RingtoetsPipingSurfaceLinesContextTest { [Test] public void ParameteredConstructor_DefaultValues() { // Setup var mocks = new MockRepository(); var failureMechanism = new PipingFailureMechanism(); var assessmentSection = mocks.StrictMock(); mocks.ReplayAll(); // Call var context = new RingtoetsPipingSurfaceLinesContext(failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(failureMechanism, context.WrappedData); Assert.AreSame(assessmentSection, context.AssessmentSection); mocks.VerifyAll(); } [Test] public void ParameteredConstructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Setup var failureMechanism = new PipingFailureMechanism(); // Call TestDelegate test = () => new RingtoetsPipingSurfaceLinesContext(failureMechanism, null); // Assert var exception = Assert.Throws(test); Assert.AreEqual("assessmentSection", exception.ParamName); } } }