module TestCLIWrapper

using TSML
using Statistics
using Test

using TSML.CLIWrappers:tsmlrun,rawstat,aggregatedstat,aggregatedoutput,imputedstat,imputedoutput

const inputname = joinpath(dirname(pathof(TSML)),"../data/testdata.csv")
const outputname = joinpath(dirname(pathof(TSML)),"../data/testdata_output.csv")

function test_cli()
  op1=tsmlrun(inputname,"")
  op2=imputedoutput(inputname,"")
  @test mean(op1[:Value] .== op2[:Value]) == 1.0
  op5=tsmlrun(inputname,"","dd/mm/yyyy HH:MM","stat")
  op6=imputedstat(inputname,"")
  @test sum(op5[1,:] .== op6[1,:]) == 20
end
@testset "CLIWrapper: check cliwrapper" begin
  test_cli()
end


end
