##############################################
# Default output 
output_default <- "DATA SUMMARY:
lonlat_prec months: March, February 
lonlat_prec range: Mar 01 2011 to Mar 31 2013 
lonlat_prec dimensions: 
dataset  member   sdate   ftime     lat     lon  
      1       6       3      31       4       4  
Statistical summary of the data in  lonlat_prec : 
NA-Indices per Dimension
dataset:  member:  sdate:  ftime:  lat:  lon:  
Number of NAs in NA-Indices per Dimensions
dataset:  member:  sdate:  ftime:  lat:  lon:  
Loaded files:
/esarchive/exp/ecmwf/system5c3s/daily_mean/prlr_s0-24h/prlr_20101101.nc
/esarchive/exp/ecmwf/system5c3s/daily_mean/prlr_s0-24h/prlr_20111101.nc
/esarchive/exp/ecmwf/system5c3s/daily_mean/prlr_s0-24h/prlr_20121101.nc 
--------------------------------------------- "

# Conditional output
output_conditional <- "DATA SUMMARY:
lonlat_prec months: March, February 
lonlat_prec range: Mar 01 2011 to Mar 31 2013 
lonlat_prec dimensions: 
dataset  member   sdate   ftime     lat     lon  
      1       6       3      31       4       4  
Statistical summary of the data in  lonlat_prec : 
--------------------------------------------- "

##############################################

test_that("1. Output checks", {
  # Default output
  actual_out <- capture.output(CST_summary(lonlat_prec))
  expect_out <- capture.output(cat(output_default))
  expect_equal(
    actual_out, 
    expect_out
    )
  
  # Conditional output               
  actual_out <- capture.output(CST_summary(lonlat_prec, loaded_files = FALSE, show_NA = FALSE))
  expect_out <- capture.output(cat(output_conditional))
  
  expect_equal(
    actual_out, 
    expect_out
  ) 
})

