Write a junit test to verify that a personalcalendar object

Assignment Help Computer Engineering
Reference no: EM132095201

Please don't answer if you cannot complete all the requirements. This question has been answered but it was incorrect!!!

You are to write the following PersonalCalendar, Event and Appointment classes and other interfaces or classes as necessary. Note that there is no main method required in this assignment; a JUnit test will be used instead.

Some details of the implementation are left to you. Other details are implied, but not stated directly, in the description. (That said, don't over think this; do the minimum required to perform the specified function.)

You are to write a class PersonalCalendar. Entries in a PersonalCalendar can be either an Event or an Appointment. Entries can be added to, returned from and removed from the PersonalCalendar.

An Event has a date consisting of ints for year, month, dayOfMonth, hour and minute. It also has a String description, a String location and an int duration in minutes. Events do not have attendees. Two Event objects are equal if their dates and descriptions are equal.

An Appointment has a date consisting of ints for year, month, dayOfMonth, hour and minute. It has an int duration in minutes and a String description.

An Appointment also has an ArrayList of Strings for attendees. Attendees can be added to an Appointment. An Appointment does not have a location--that's assumed to be my office. Appointment has an equals method that compares dates and descriptions to determine equality.

A PersonalCalendar maintains its entries sorted by date, not the order the entries were inserted. Thus the first element of a PersonalCalendar is always the fist element chronologically, regardless of the order the elements were added. If two elements have exactly the same date and time, description is used to break the tie. (Hint: GregorianCalendar and Collections.sort. Also let your IDE help you write commonly used code.)

You are to write a JUnit test to verify that a PersonalCalendar object maintains its entries in the correct order.

Here are some bullets I will use in grading

PersonalCalendar accepts both Event and Appointment objects

PersonalCalendar does not accept objects such as String

PersonalCalendar keeps its content sorted appropriately

Event implements the specified function

Appointment implements the specified function

JUnit tests verify the following:

A PersonalCalendar with a single Appointment or Event contains the expected object.

A PersonalCalendar returns its objects sorted first by date and then description, regardless of the order the objects were added, and regardless of whether the items were all Events, or all Appointments, or a mixture.

My JUnit test class was long, but that was mostly because I did a lot of copy/paste for test setup. None my other components were more than 50 lines of code.

Reference no: EM132095201

Questions Cloud

Relatives in warning processes : What is the role of peer contacts friends, neighbors, and relatives in warning processes?
Design a 3-bits asynchronous counter : Design a 3-bits asynchronous counter that have both "count up" and "count down" ability.
Prepare the journal entries assuming commercial substance : Pizza Company trades its used delivery cars for a new models at Hudson Toyota. Prepare the journal entries assuming commercial substance
Work breakdown structure : Can anyone provide in a hypothetical situation a 4 level "work breakdown structure" task (using MS Word tool) for a moving company
Write a junit test to verify that a personalcalendar object : Write the following PersonalCalendar, Event and Appointment classes and other interfaces or classes as necessary.
Provide an implementation of a singly-linked list : Provide an implementation of a singly-linked list and demonstrate a merge() function that merges a linked list into another at alternating positions.
Sales division of a large consumer goods company : John Dakota works in the sales division of a large consumer goods company. Many of his coworkers have noticed a drop in his performance
Compute contribution margin ratio for current production : The additional costs would be accounted for as fixed manufacturing overhead. Compute contribution margin ratio for current production
Create the most engaging shopping experience : QVC combines the best of retail, media and social to create the most engaging shopping experience, one that exceeds the expectations of everyone

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create an array of numbers representing the amount each slip

Create an array of numbers, representing the amount each slip is rented for (monthly). Populate the array with some dollar amounts (with two decimal places).

  Why should duties be segregated

Why should duties be segregated? What if management has inadequate staff to properly segregate all duties?

  Write a function to mirror along the diagonal

Write a function to mirror along the diagonal from (0, height) to (width, 0). Write a function to mirror along the diagonal from (0, 0) to (width, height).

  Describing the risk management plan

You are an information technology (IT) intern working for Health Network, Inc. (Health Network), a fictitious health services organization headquartered.

  What is the eight-hex-digit address of the last byte

Suppose that you have a 32-bit PC with 512MB of RAM. What is the eight-hex-digit address of the "last" byte of installed memory

  Write a java program that prints all real solutions

make a class QuadraticEquation whose constructor receives the coefficients a, b, c of the quadratic equation. Supply methods getSolution1 and getSolution2 that get the solutions, using the quadratic formula, or 0 if no solution exists. The getSolu..

  How mmu translates logical addresses into physical addresses

The 68451 MMU employs a segmented memory mapping scheme. What does this mean? List the advantages and disadvantages of the 68451 approach to memory management.

  What is the significance of optimizing the design

What is the significance of optimizing the design

  Locate all irreducible polynomials

polynomials of lower degree and check whether they are factors - Locate all irreducible polynomials

  Write a program that draws iterations of the snowflake shape

Write a program that draws the iterations of the snowflake shape. Supply a button that, when clicked, produces the next iteration.

  Write some cpp code that will read a line of text

Write some C++ code that will read a line of text and echo the line with all uppercase letters deleted. Rewrite the definition of the new Line function.

  Two-way authentication between humans and computers

There is a lot of work being done on phishing, but none of it is so far a convincing solution to the problem - Are there any neat ways

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd