public void BuildInterval( int lowerBoundaryPoint, int upperBoundaryPoint) { var interval = IntervalFactory.BuildOpenInterval( lowerBoundaryPoint: lowerBoundaryPoint, upperBoundaryPoint: upperBoundaryPoint, comparer: Comparer <int> .Default); Assert.IsType <Interval <int> >( @object: interval); }
public void IntersectWithOpenIntervalIsOpenInterval( int lowerBoundaryPoint, int upperBoundaryPoint) { var infinityInterval = IntervalFactory.BuildInfinityInterval <int>(); var result = infinityInterval.Intersect( rightInterval: IntervalFactory.BuildOpenInterval( lowerBoundaryPoint: lowerBoundaryPoint, upperBoundaryPoint: upperBoundaryPoint, comparer: Comparer <int> .Default), comparer: Comparer <int> .Default); Assert.IsType <Interval <int> >(result); Assert.IsType <OpenLowerBound <int> >(((Interval <int>)result).LowerBound); Assert.IsType <OpenUpperBound <int> >(((Interval <int>)result).UpperBound); }