in Education by
Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public SystemInfo(IMapinfoWrapper mapinfoWrapper) { this.wrapper = mapinfoWrapper; } Do I need to write a unit test for this construtor? I don't have any getters for the wrapper variable, so I don't need to test that. 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
Unit testing is about testing the public states, behaviors, and interactions of your objects. If you simply set a private field in your constructor, what is there to test? Don't bother unit-testing your simple accessors and mutators. That's just silly, and it doesn't help anyone.

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
    Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    In my tests I need to test what happens when an OracleException is thrown (due to a stored procedure ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    I'm using restful routing module for asp.net mvc and very happy with it. But I can't get one ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    How would you test this scenario? I've just started looking into NHibernate and having my first bash at ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 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
    I would like to use assertions in my cucumber tests such as this: Then /^I am taken to the page ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    I want to unit test the code below. I've been working with MSTest and I tried to learn Microsoft ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Arrange in order- A. running unit test B. running static code check C. check for code D. Build Package...
asked Mar 7, 2021 in Technology by JackTerrance
0 votes
    Physical _________ is important to check & test for possible physical breaches. (a) penetration test (b) security check ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 5, 2021 in Education by JackTerrance
...