// Path: chapter04/src/main/java/com/blogspot/toomuchcoding/book/chapter4/common/returningvalue/MeanTaxFactorCalculator.java
// public class MeanTaxFactorCalculator {
// 
//     private final TaxFactorFetcher taxFactorFetcher;
// 
//     public MeanTaxFactorCalculator(TaxFactorFetcher taxFactorFetcher) {
//         this.taxFactorFetcher = taxFactorFetcher;
//     }
// 
//     public double calculateMeanTaxFactorFor(Person person) {
//         double taxFactor = taxFactorFetcher.getTaxFactorFor(person);
//         double anotherTaxFactor = taxFactorFetcher.getTaxFactorFor(person);
//         return (taxFactor + anotherTaxFactor) / 2;
//     }
// 
// }


import com.blogspot.toomuchcoding.book.chapter4.common.exception.InvalidTaxFactorException;
import com.blogspot.toomuchcoding.book.chapter4.common.exception.TaxServiceUnavailableException;
import com.blogspot.toomuchcoding.book.chapter4.common.returningvalue.MeanTaxFactorCalculator;
import com.blogspot.toomuchcoding.book.chapter4.common.returningvalue.TaxFactorFetcher;
import com.blogspot.toomuchcoding.common.testng.MockitoTestNGListener;
import com.blogspot.toomuchcoding.person.Person;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import static com.googlecode.catchexception.CatchException.caughtException;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.when;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
package com.blogspot.toomuchcoding.book.chapter4._3_StubbingMethodThatThrowsException.subsequent.hamcrest;



@Listeners(MockitoTestNGListener.class)
public class MeanTaxFactorCalculatorTestNgTest {

    @Mock TaxFactorFetcher taxFactorFetcher;

// Path: chapter04/src/main/java/com/blogspot/toomuchcoding/book/chapter4/common/returningvalue/MeanTaxFactorCalculator.java
// public class MeanTaxFactorCalculator {
// 
//     private final TaxFactorFetcher taxFactorFetcher;
// 
//     public MeanTaxFactorCalculator(TaxFactorFetcher taxFactorFetcher) {
//         this.taxFactorFetcher = taxFactorFetcher;
//     }
// 
//     public double calculateMeanTaxFactorFor(Person person) {
//         double taxFactor = taxFactorFetcher.getTaxFactorFor(person);
//         double anotherTaxFactor = taxFactorFetcher.getTaxFactorFor(person);
//         return (taxFactor + anotherTaxFactor) / 2;
//     }
// 
// }


// Path: chapter04/src/test/java/com/blogspot/toomuchcoding/book/chapter4/_3_StubbingMethodThatThrowsException/subsequent/hamcrest/MeanTaxFactorCalculatorTestNgTest.java
import com.blogspot.toomuchcoding.book.chapter4.common.exception.InvalidTaxFactorException;
import com.blogspot.toomuchcoding.book.chapter4.common.exception.TaxServiceUnavailableException;
import com.blogspot.toomuchcoding.book.chapter4.common.returningvalue.MeanTaxFactorCalculator;
import com.blogspot.toomuchcoding.book.chapter4.common.returningvalue.TaxFactorFetcher;
import com.blogspot.toomuchcoding.common.testng.MockitoTestNGListener;
import com.blogspot.toomuchcoding.person.Person;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import static com.googlecode.catchexception.CatchException.caughtException;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.when;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;

package com.blogspot.toomuchcoding.book.chapter4._3_StubbingMethodThatThrowsException.subsequent.hamcrest;



@Listeners(MockitoTestNGListener.class)
public class MeanTaxFactorCalculatorTestNgTest {

    @Mock TaxFactorFetcher taxFactorFetcher;

    @InjectMocks MeanTaxFactorCalculator systemUnderTest;