t.Errorf("Test %d: %s: Expected to pass, but failed with: <ERROR> %s",i+1,instanceType,err.Error())
}
iferr==nil&&!testCase.shouldPass{
t.Errorf("Test %d: %s: Expected to fail with <ERROR> \"%s\", but passed instead",i+1,instanceType,testCase.err.Error())
}
// Failed as expected, but does it fail for the expected reason.
iferr!=nil&&!testCase.shouldPass{
iftestCase.err.Error()!=err.Error(){
t.Errorf("Test %d: %s: Expected to fail with error \"%s\", but instead failed with error \"%s\" instead",i+1,instanceType,testCase.err.Error(),err.Error())
}
}
// Test passes as expected, but the output values are verified for correctness here.
iferr==nil&&testCase.shouldPass{
iftestCase.result.Bucket!=result.Bucket{
t.Fatalf("Test %d: %s: Expected Bucket name to be '%s', but found '%s' instead",i+1,instanceType,testCase.result.Bucket,result.Bucket)
}
iftestCase.result.Name!=result.Name{
t.Errorf("Test %d: %s: Expected Object name to be %s, but instead found it to be %s",i+1,instanceType,testCase.result.Name,result.Name)
t.Errorf("Test %d: %s: Expected Content Type of the object to be %v, but instead found it to be %v",i+1,instanceType,testCase.result.ContentType,result.ContentType)
}
iftestCase.result.IsDir!=result.IsDir{
t.Errorf("Test %d: %s: Expected IsDir flag of the object to be %v, but instead found it to be %v",i+1,instanceType,testCase.result.IsDir,result.IsDir)