@ -15,7 +15,7 @@ func Test_validateDataForSotaCsv(t *testing.T) {
want error
} {
{
"Happy Case ",
"Happy Case (activator) ",
args { loadedLogFile : [ ] LogLine {
{ Date : "date" , MyCall : "myCall" , MySOTA : "mySota" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "mySota" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" } ,
@ -23,6 +23,15 @@ func Test_validateDataForSotaCsv(t *testing.T) {
} ,
nil ,
} ,
{
"Happy Case (chaser)" ,
args { loadedLogFile : [ ] LogLine {
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" , SOTA : "Sota1" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" , SOTA : "Sota2" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" , SOTA : "Sota3" } } ,
} ,
nil ,
} ,
{
"Missing Date" ,
args { loadedLogFile : [ ] LogLine {
@ -42,13 +51,31 @@ func Test_validateDataForSotaCsv(t *testing.T) {
fmt . Errorf ( "Missing MyCall" ) ,
} ,
{
"Missing MySota" ,
"Neither Activator nor Chaser" ,
args { loadedLogFile : [ ] LogLine {
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:01" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:02" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:03" , Call : "call" } } ,
} ,
fmt . Errorf ( "missing SOTA reference while attempting to process chaser log for log entry at 12:01 (#1), missing SOTA reference while attempting to process chaser log for log entry at 12:02 (#2), missing SOTA reference while attempting to process chaser log for log entry at 12:03 (#3)" ) ,
} ,
{
"SOTA Chaser log with one reference missing" ,
args { loadedLogFile : [ ] LogLine {
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:01" , Call : "call" , SOTA : "Sota1" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:02" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "12:03" , Call : "call" , SOTA : "Sota3" } } ,
} ,
fmt . Errorf ( "missing SOTA reference while attempting to process chaser log for log entry at 12:02 (#2)" ) ,
} ,
{
"SOTA Chaser log with mySota redefinition" ,
args { loadedLogFile : [ ] LogLine {
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : "time" , Call : "call" } } ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : " 12:01 ", Call : "call ", SOTA : "Sota1 "} ,
{ Date : "date" , MyCall : "myCall" , MySOTA : " mySota ", Mode : "mode" , Band : "band" , Time : " 12:02 ", Call : "call ", SOTA : "Sota2 "} ,
{ Date : "date" , MyCall : "myCall" , MySOTA : "" , Mode : "mode" , Band : "band" , Time : " 12:03 ", Call : "call ", SOTA : "Sota3 "} } ,
} ,
fmt . Errorf ( "Missing MY-SOTA reference" ) ,
fmt . Errorf ( " encountered an unexpexted MySota reference while processing what should be a chaser log for log entry at 12:02 (#2) ") ,
} ,
{
"Misc. missing data (Band, Time, Mode, Call)" ,