Question: Your task is to generate a set of developer defined data types to represent the primary objects for managing a tour list. The evaluation rubric
Your task is to generate a set of developer defined data types to represent the primary objects for managing a tour list.
The evaluation rubric is in the Feedback folder.
A NET Solution file with a class library project and an Unit test project has already been provided to you and can be found in the sre folder. Use this solution when providing your answers for this assessment. Do not create your own solutions or projects for this assessment.
In this assessment, you are required to demonstrate your ability to:
Code C# classes complete with properties, fields, constructors, andor methods
Ensure proper functionality of your classesobjects by use of exceptions for invalid inputs
Prove the validity of your solution through unit tests
@ Use Frequent Commits
Commit your work at the end of each and every Activity. Marks may be deducted based on the commit activity in your repository. Ensure you sync your local clone to GitHub before the end of class. The classroom assessment ends at the end of class period. It is your responsibility to ensure your work is properly submitted. Failure to submit your work may result in deductions up to and including a final mark of zero for this assessment.
General Validation Rules
Your classes must throw exceptions for all invalid inputs. Do not attempt to perform any console inputoutput in your code. Here are some general validation requirements.
General Validation Rules
Your classes must throw exceptions for all invalid inputs. Do not attempt to perform any console inputoutput in your code. Here are some general validation requirements.
Exceptions must have meaningful error messages.
Use the following exception types for validation.
Missing value for parameter:
ArgumentNullException
Invalid values not in the proper range example non postive limit:
ArgumentOutfRangeException
All string information must contain text. Null, empty, and plain whitespace text is not allowed. Sanitize your strings by trimming the leading and trailing whitespace if a string exists.
Unit Testing
Create your unit tests within the appropriate files supplied for you in the xUnit Testing project. All tests can be implemented as Fact s unless otherwise directed. Use FluentAssertions for your unit tests. Create meaningful names for your unit test methods. Do not create an exhaustive test suite; only the requested unit tests need to be coded.
Activity: Destination class
The Destination.cs file has been created for you in the class library project. Complete the
Destination
class
definition by providing all its members according to the class diagram.
The
Destination
class' properties are to be autoimplemented properties with private setters:
a
string
called
Location
cannot be blank and must be trimmed
one DateTime called
VisitDate
must be today or in the future
Validate and initialize these data properties using a greedy constructor.
Override the
Tostring
method to return the Destination's data, as a comma delimited string.
@ Destination Stould class
Prove the validity of your Destination
class by writing tests for the following:
Ensure that the Location and date data has been properly stored via the greedy constructor.
Check that improper data for VisitDate
rActivity : Transport
class
The Transport.cs
file has been created for you in the class library project. Complete the
Transport
class definition by
providing all its members according to the class diagram.
The
Transport
class requires two fully implemented public properties public
get
set :
deg a string
called
Name cannot be blank and must be trimmed
an integer
called
Capacity
must be a positive nonzero value
Implement a greedy constructor.
Validation is performed within the properties.
Override the Tosfring
method to return the Transport's data, as a comma delimited sTransportation Should class
Prove the validity of your Transport class by writing tests for the following:
Ensure that valid data can be stored directly through the
Capacity
Check that invalid data for Capacity
property
throws an ArgumentOutfRangeException
Activity : The Tour class
The Tour.cs file has been created for you in the class library project. Complete the Tour all its members according to the class diagram. The
TourType
class definition by providing
enumeration has already been coded for you.
A Tour
consists of the following nonnull data:
Name of type string a fullyimplemented property public
get
set
performs validation in the setter cannot be blank and must be trimmed
Type of type
TourType
an autoimplemented property public
get
set
Vehicle
of type Transport
an autoimplemented property public
get private
set
Sites of type ListDestination an autoimplemented property public get private set
Stops
of type
integer
a fullyimplemented property, public get only
The property Stops wtring.esults in an ArgumentOutfRangeException. Implement a greedy constructor that recieves a name tourType order vehicle and a list the vehicle cannot be null.
the list
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
