// 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.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 org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
package com.blogspot.toomuchcoding.book.chapter4._2_StubbingMethodThatReturnValues.varargs.hamcrest;



@Listeners(MockitoTestNGListener.class)
public class MeanTaxFactorCalculatorTestNgTest {

    @Mock TaxFactorFetcher taxFactorFetcher;

    @InjectMocks MeanTaxFactorCalculator systemUnderTest;

    @Test
// 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/_2_StubbingMethodThatReturnValues/varargs/hamcrest/MeanTaxFactorCalculatorTestNgTest.java
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 org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;

package com.blogspot.toomuchcoding.book.chapter4._2_StubbingMethodThatReturnValues.varargs.hamcrest;



@Listeners(MockitoTestNGListener.class)
public class MeanTaxFactorCalculatorTestNgTest {

    @Mock TaxFactorFetcher taxFactorFetcher;

    @InjectMocks MeanTaxFactorCalculator systemUnderTest;

    @Test
    public void should_calculate_mean_tax_factor_for_two_different_tax_factors() {