github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/client/controllers/cont_suivi_camps_test.go (about)

     1  package controllers
     2  
     3  import (
     4  	"fmt"
     5  	"path"
     6  	"strconv"
     7  	"testing"
     8  	"time"
     9  
    10  	dm "github.com/benoitkugler/goACVE/server/core/datamodel"
    11  )
    12  
    13  func TestBilansFinanciers(t *testing.T) {
    14  	base := dm.GetLocalDBDev()
    15  	p := SuiviCamps{Base: base}
    16  	// b := true
    17  	fmt.Printf("Bilan des %d camps \n", len(p.Base.Camps))
    18  	ti := time.Now()
    19  	var ids []int64
    20  	for _, camp := range p.Base.GetCamps(false, 0) {
    21  		ids = append(ids, camp.Id)
    22  	}
    23  	b := p.BilansFinanciers(ids)
    24  	fmt.Println(time.Since(ti))
    25  	fmt.Println(b)
    26  
    27  }
    28  
    29  func TestLienInscription(t *testing.T) {
    30  	Server = newServerTest()
    31  	var idCamp int64 = 45
    32  	idCampS := strconv.FormatInt(idCamp, 10)
    33  	lien := Server.EndpointURL(path.Join(EndpointInscription, idCampS))
    34  	fmt.Println(lien)
    35  }