Skip to content

fatalaijon/unittesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Testing a Fraction class and List Utilities

Build Status codecov

Unit testing assignment from the ISP course at Kasetsart University.

Test Cases for unique

Write a table describing your test cases.

Test case Expected Result
empty list empty list
one item list with 1 item
one item many times list with 1 item
2 items, many times, many orders 2 item list, items in same order
what other test case? what result?

Test Cases for Fraction

Extended number arithmetic is beyond the requirements of this assignment, but I tested these anyway out of curiosity. In most cases, operations get the correct result w/o any special code.

infinity means Fraction(1,0), -infinity is Fraction(-1,0), and NaN is Fraction(0,0). f means any finite, non-zero fraction.

Test case Expected Result
add typical fractions correct sum
f + zero f
f + infinity f
infinity + infinity infinity
zero + infinity infinity
NaN + infinity NaN
infinity + -infinity NaN
NaN + anything NaN

About

Unit testing assignment from KU's ISP course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages