public void TestBoundedSeq() { int[] lengthOk = new int[] { 1, 2, 3 }; int[] result = m_testService.EchoBoundedSeq(lengthOk); Assert.IsNotNull(result); Assert.AreEqual(lengthOk.Length, result.Length); for (int i = 0; i < result.Length; i++) { Assert.AreEqual(lengthOk[i], result[i]); } int[] tooLong = new int[] { 1, 2, 3, 4 }; try { m_testService.EchoBoundedSeq(tooLong); Assert.Fail("expected BAD_PARAM exception, because sequence too long, but not thrown"); } catch (BAD_PARAM badParamE) { Assert.AreEqual(badParamE.Minor, 3434); } }