Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 846569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:38:06+00:00 2026-05-15T06:38:06+00:00

I have such a set of Constructors: public BusinessObjectContext() : this(CloudStorageAccount.FromConfigurationSetting(DataConnectionString).TableEndpoint.ToString(), CloudStorageAccount.FromConfigurationSetting(DataConnectionString).Credentials) {} public

  • 0

I have such a set of Constructors:

public BusinessObjectContext()
         : this(CloudStorageAccount.FromConfigurationSetting("DataConnectionString").TableEndpoint.ToString(),
                CloudStorageAccount.FromConfigurationSetting("DataConnectionString").Credentials) {}

public BusinessObjectContext(string dataConnectionString)
         : this(CloudStorageAccount.Parse(dataConnectionString).TableEndpoint.ToString(),
                CloudStorageAccount.Parse(dataConnectionString).Credentials) { }

public BusinessObjectContext(String baseAddress, StorageCredentials credentials) 
         : base(baseAddress, credentials) { } 

However when testing / Mocking I need the object without any of the connection string parameters. How can I do this – preferrably in Moq?

Is this possible at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:38:07+00:00Added an answer on May 15, 2026 at 6:38 am

    It sounds as if you have a code smell – the constructor is doing too much work. The article includes a set of fixes for such scenarios. Basically the answer is to only perform assignment in constructors, not execute business logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a property such as IdentityCode string IdentityCode {get;set;} my IdentityCode has three
I have a class that looks like this: public class UploadBean { protected UploadBean(Map<String,?>
I have a class such as: public MyClass { public myEnumType Status {get;set;} public
I have such an AppleScript: tell application Firefox activate set the bounds of the
I have such a query: UPDATE `user` SET mail='abc@abc' WHERE id = IF((SELECT admin
I'm trying to multithread something and i have my program set up such that
Have a JUNIT test set up as such @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ /applicationContext.xml, /applicationContext-security.xml }) @TransactionConfiguration(defaultRollback
Assuming I have a large set of Coordinates such us (3,4) , (5,-6) ,
How can I set a default value such as don't have any information instead
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.