public void MixedAnalysisReturnsProperValue()
        {
            ICompanyValuator valuator = new CompanyValuator();

            var substantialValue = 3000m;
            var k1 = new Interval(0.04738m, 0.04872m);
            var k2 = new Interval(0.05425m, 0.05786m);
            var k3 = new Interval(0.05183m, 0.05436m);

            var expectedInterests = new List<Interval> { k1, k2, k3 };

            var cfl1 = new Interval(4898, 5361);
            var cfl2 = new Interval(4166, 5306);
            var cfl3 = new Interval(2499, 3680);

            var expectedBenefits = new List<Interval> { cfl1, cfl2, cfl3 };

            var result = valuator.MixedAnalysis(substantialValue, expectedBenefits, expectedInterests);

            var expectedResult = new Interval(11913m, 14046m);

            Assert.NotNull(result);
            Assert.AreEqual(expectedResult.LowerBound, Math.Round(result.LowerBound));
            Assert.AreEqual(expectedResult.UpperBound, Math.Round(result.UpperBound));
        }
 public void MixedAnalysisThrowsIfDifferentAmountOfIntervals()
 {
     decimal substantialValue = 3000;
     var expectedInterests = new List<Interval> { new Interval(), new Interval() };
     var expectedBenefits = new List<Interval> { new Interval(), new Interval(), new Interval() };
     ICompanyValuator valuator = new CompanyValuator();
     Assert.Throws<ValuationException>(() => valuator.MixedAnalysis(substantialValue, expectedBenefits, expectedInterests));
 }
 public void MixedAnalysisThrowsIfNullRates()
 {
     decimal substantialValue = 3000;
     ICompanyValuator valuator = new CompanyValuator();
     Assert.Throws<ArgumentNullException>(() => valuator.MixedAnalysis(substantialValue, new List<Interval>(), null));
 }
        public void MixedAnalysisReturnsProperValueIfEmptyIntervals()
        {
            decimal substantialValue = 3000;
            var expectedInterests = new List<Interval>();
            var expectedBenefits = new List<Interval>();
            ICompanyValuator valuator = new CompanyValuator();
            var result = valuator.MixedAnalysis(substantialValue, expectedBenefits, expectedInterests);

            Assert.NotNull(result);
            Assert.AreEqual(3000, result.UpperBound);
            Assert.AreEqual(3000, result.LowerBound);
        }