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 6726719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:37+00:00 2026-05-26T09:57:37+00:00

I have the following property: public double TotalHours { get { return (from session

  • 0

I have the following property:

public double TotalHours
{
    get
    {
        return (from session in sessions
                let ts = session.End.Subtract(session.Start)
                select ts.TotalHours).Sum();
    }
}

The property should sum all hours done in all sessions.
What do I need to test in order to ensure that the property is always summing all the hours from all sessions?

  • 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-26T09:57:37+00:00Added an answer on May 26, 2026 at 9:57 am

    It’s basically a case of working out appropriate sample data. For example, you might want to try tests for:

    • No sessions
    • A single session
    • Multiple sessions
    • Sessions with no start time or not end time
    • A session where the end is before the start
    • A session where the end equals the start

    Maybe you’ve got other data validation to ensure that the “dodgy-sounding” situations don’t occur, but those are the kinds of things I’d think about.

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

Sidebar

Related Questions

i have the following property declaration Public Property IsAreaSelected() As Integer Get Return If(ViewState(IsAreaSelected)
I have the following property public MyType MyProperty {get;set;} I want to change this
I have this property public List<PointK> LineList {get;set;} Where PointK consists of the following
I have the following Auto Property [DefaultValue(true)] public bool RetrieveAllInfo { get; set; }
Let's say I have the following class structure (simplified from my real-world problem): Public
I am using the XmlSerializer and have the following property in a class public
I have the following dependency property inside a class: class FooHolder { public static
Lets consider that I have a public property called AvatarSize like the following, public
I have the following property defined. MyLibrary.PumpSignal is an enum as follows: Public Enum
Let's say I have the following code: protected void ReservationForm() { double x =

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.