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

  • SEARCH
  • Home
  • 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 6112889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:47:47+00:00 2026-05-23T14:47:47+00:00

so I have /// <summary> ///We cannot sell to someone who’s address postcode is

  • 0

so I have

 /// <summary>
        ///We cannot sell to someone who's address postcode is Channel Islands = GY 
        /// or Isle of Man = IM.
        /// So there are three possibilities... an unclear channel islands I.D. needs a pop up, an error or invalid country needs a pop up and a good match can display policyholder
        ///
        /// </summary>
        public void ValidateAddressCanPurchaseInsurance(PolicyHolder p)
        {
            if (p == null) {DisplayErrorPopup(@"Could not check address for this person - Dang!"); return;}

            var countryResult = IdentifyUnavailableAddresses(p);

            if (countryResult == UnavailableAddressMatch.UnmatchedChannelIslands) {DisplayErrorPopup("Couldn't determine whether this Channel Islands resident is Jersey or Guernsey based... fix postcode and retry application"); return;}
            if (countryResult == UnavailableAddressMatch.Guernsey || countryResult == UnavailableAddressMatch.IsleOfMan) { DisplayErrorPopup(countryResult); return;}
            if (countryResult == UnavailableAddressMatch.None) { DisplayPolicyHolder(p); return; }
            DisplayErrorPopup(String.Format("Something very odd has gone on while trying to validate the address of this person! {0}",p.MembershipNumber));
        }

Which I can’t really test… I can obviously test IdentifyUnavailableAddresses() and do but I’d like to pass a set of policyHolders to this method and see that it behaves as I expect.

Display Error Popup will take an UnavailableAddressMatch enum and format a pop-up message appropriately or take a string and put it in a pop-up

This method lives in a class that determines the behaviour of a Windows Form…

  • 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-23T14:47:47+00:00Added an answer on May 23, 2026 at 2:47 pm

    ValidateAddressCanPurchaseInsurance is a business layer method. DisplayErrorPopup is a UI thing. They do not belong in the same class.

    Putting DisplayErrorPopup in another class makes it possible to put a mock object in your unit test and check whether DisplayErrorPopup is called.

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

Sidebar

Related Questions

I have this XML (Flash/AS3): <channel> <title>...</title> <description>...</description> <item><summary>...</summary><detail>...</detail></item> <item><summary>...</summary><detail>...</detail></item> ... </channel> I want
I need to have a summary field in each page of the report and
Quick summary: I have a Rails app that is a personal checklist / to-do
I have column named summary (tinytext, utf8_turkish_ci). I know it can store 255 byte
Summary A parent can have many children. How do you write a service such
--Summary (shortened)-- I have a controller that loads a profile object from the corresponding
Summary: Every field rows of detailsview have 2 td and their first td can
I have an object Title : foo Summary : foo bar Body : this
I have an SSRS report where I need to collapse data into a summary
You may have noticed that we now show an edit summary on Community Wiki

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.