import GreyDecision.Utility: makeminmax
import GreyDecision.GreyNumbers: GreyNumber
import GreyDecision.Marcos: marcos

@testset "Marcos" begin
    tol = 0.0001
    
    weights = [0.19019, 0.15915, 0.19819, 0.19019, 0.15115, 0.11111]

    fns = [maximum, maximum, maximum, maximum, maximum, maximum]
    Fns = convert(Array{Function,1}, fns)

    decmat = [
        8.675 8.433 8.000 7.800 8.025 8.043
        8.825 8.600 7.420 7.463 7.825 8.229
        8.325 7.600 8.040 7.700 7.925 7.600
        8.525 8.667 7.180 7.375 7.750 8.071
    ]

    nrow, ncol = size(decmat)
    # Converting white decision matrix to
    # grey decision matrix
    greydecmat = Array{GreyNumber{Float64}, 2}(undef, nrow, ncol)

    for i in 1:nrow
        for j in 1:ncol 
            greydecmat[i, j] = GreyNumber(decmat[i, j])
        end
    end

    result = marcos(greydecmat, weights, Fns)

    @test result[:bestIndex] == 1
    @test isapprox(result[:scores][1].a, 0.684865943528, atol = tol)
    @test isapprox(result[:scores][2].a, 0.672767106696, atol = tol)
    @test isapprox(result[:scores][3].a, 0.662596906139, atol = tol)
    @test isapprox(result[:scores][4].a, 0.661103207660, atol = tol)
    
end
