github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/when/validate_integration_test.go (about) 1 //go:build integration 2 // +build integration 3 4 // Copyright 2021 The TrueBlocks Authors. All rights reserved. 5 // Use of this source code is governed by a license that can 6 // be found in the LICENSE file. 7 8 package whenPkg 9 10 import ( 11 "testing" 12 13 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/rpc" 14 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/utils" 15 ) 16 17 func Test_Validate(t *testing.T) { 18 var opts = WhenOptions{} 19 chain := utils.GetTestChain() 20 opts.Conn = rpc.TempConnection(chain) 21 opts.Blocks = append(opts.Blocks, "2014-01-01") 22 err := opts.validateWhen() 23 if err == nil { 24 t.Error("Parsed a date before the first block", err) 25 } 26 }