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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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