/**
 * Created by Oliver on 16.03.2016.
 */ import { Fraction } from "../../../src/Common/DataObjects/Fraction" ; describe ( "Fraction Unit Tests:" , ( ) => { describe ( "Construct Fraction, check properties" , ( ) => { const f1 = new Fraction ( 2 , 6 ) ; it ( "Numerator and Denominator" , ( done ) => { chai . expect ( f1 . Numerator ) . to . equal ( 1 ) ; chai . expect ( f1 . Denominator ) . to . equal ( 3 ) ; done ( ) ; } ) ; it ( "Real value" , ( done ) => { chai . expect ( f1 . RealValue ) . to . equal ( 1 / 3 ) ; done ( ) ; } ) ; } ) ; describe ( "Compare fractions" , ( ) => { let f1 ; let f2 ; const rand = function ( ) : number { return Math . floor ( Math . random ( ) * 500 ) + 1 ; } ; it ( "lt attribute" , ( done ) => { for ( let i = 0 ; i < 10 ; i += 1 ) { f1 = new Fraction ( rand ( ) , rand ( ) ) ; f2 = new Fraction ( rand ( ) , rand ( ) ) ; chai . expect ( f1 . lt ( f2 ) ) . to . equal ( f1 . RealValue < f2 . RealValue ) ; } done ( ) ; } ) ; } ) ; } ) ;