in Education by
In my tests I need to test what happens when an OracleException is thrown (due to a stored procedure failure). I am trying to setup Rhino Mocks to Expect.Call(....).Throw(new OracleException()); For whatever reason however, OracleException seems to be sealed with no public constructor. What can I do to test this? Edit: Here is exactly what I'm trying to instantiate: public sealed class OracleException : DbException { private OracleException(string message, int code) { ...} } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
For oracle's managed data access (v 4.121.1.0) the constructor changed again var ci = typeof(OracleException).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(string), typeof(string), typeof(string) }, null); var c = (OracleException)ci.Invoke(new object[] { 1234, "", "", "" });

Related questions

0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    We have redesigned the structure to a website which has several business units. Now I want to redirect (301 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I'm working on an extension (BHO) for Internet Explorer, and having trouble attaching a .NET delegate to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Designing a registration form, and I get this error when adding in MessageBoxButtons and MessageBoxIcon. The error ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    Designing a registration form, and I get this error when adding in MessageBoxButtons and MessageBoxIcon. The error ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    Working on a project using sqlServer 2008. EDIT for clarification : table 1 contains 1 field that has to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B? ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    A guy I work with gave me the EC2 credentials to log onto his EC2 console. I was not the one who set it up ... these show up as blank. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    This question's answers are a community effort. Edit existing answers to improve this post. It is not ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    How should I handle this exception for API data requester? The Dostuff1,2,3 is 3 different functions that ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...