package mathUtil

import (
	"fmt"
	"testing"
)

func TestQuartile(t *testing.T) {

	intList := []int{}
	var lower, mid, upper float64
	var err error
	lower, mid, upper, err = Quartile_Int(intList)
	if err != nil {
		fmt.Printf("Error:%s\n", err)
	}

	intList = []int{4}
	lower, mid, upper, err = Quartile_Int(intList)
	if err != nil {
		fmt.Printf("Error:%s\n", err)
	}
	fmt.Printf("LowerQuartile:%f\n", lower)
	fmt.Printf("MidQuartile:%f\n", mid)
	fmt.Printf("UpperQuartile:%f\n", upper)

	intList = []int{4, 93}
	lower, mid, upper, err = Quartile_Int(intList)
	if err != nil {
		fmt.Printf("Error:%s\n", err)
	}
	fmt.Printf("LowerQuartile:%f\n", lower)
	fmt.Printf("MidQuartile:%f\n", mid)
	fmt.Printf("UpperQuartile:%f\n", upper)

	intList = []int{4, 93, 84}
	lower, mid, upper, err = Quartile_Int(intList)
	if err != nil {
		fmt.Printf("Error:%s\n", err)
	}
	fmt.Printf("LowerQuartile:%f\n", lower)
	fmt.Printf("MidQuartile:%f\n", mid)
	fmt.Printf("UpperQuartile:%f\n", upper)

	intList = []int{4, 93, 84, 85, 80, 37, 81, 93, 27, 12}
	lower, mid, upper, err = Quartile_Int(intList)
	if err != nil {
		fmt.Printf("Error:%s\n", err)
	}
	fmt.Printf("LowerQuartile:%f\n", lower)
	fmt.Printf("MidQuartile:%f\n", mid)
	fmt.Printf("UpperQuartile:%f\n", upper)
}
