diff --git a/internal/adapter/repository_ennoblement_test.go b/internal/adapter/repository_ennoblement_test.go index 2f309d9..ae61993 100644 --- a/internal/adapter/repository_ennoblement_test.go +++ b/internal/adapter/repository_ennoblement_test.go @@ -64,7 +64,7 @@ func testEnnoblementRepository(t *testing.T, newRepos func(t *testing.T) reposit ennoblements, err := repos.ennoblement.List(ctx, listParams) require.NoError(t, err) - res := make(map[string][]int) + m := make(map[string][]int) for _, p := range params { key := fmt.Sprintf("%s-%d", p.ServerKey(), p.Base().VillageID()) @@ -76,12 +76,12 @@ func testEnnoblementRepository(t *testing.T, newRepos func(t *testing.T) reposit cmpopts.EquateApproxTime(time.Minute), gocmp.AllowUnexported(domain.BaseEnnoblement{}), ) { - res[key] = append(res[key], i) + m[key] = append(m[key], i) } } } - for key, indexes := range res { + for key, indexes := range m { assert.Len(t, indexes, 1, key) } } diff --git a/internal/adapter/repository_player_snapshot_test.go b/internal/adapter/repository_player_snapshot_test.go index 231c0bf..54b6044 100644 --- a/internal/adapter/repository_player_snapshot_test.go +++ b/internal/adapter/repository_player_snapshot_test.go @@ -63,19 +63,19 @@ func testPlayerSnapshotRepository(t *testing.T, newRepos func(t *testing.T) repo playerSnapshots, err := repos.playerSnapshot.List(ctx, domain.NewListPlayerSnapshotsParams()) require.NoError(t, err) - res := make(map[string][]int) + m := make(map[string][]int) for _, p := range params { key := fmt.Sprintf("%s-%d-%s", p.ServerKey(), p.PlayerID(), p.Date().Format(dateFormat)) for i, ps := range playerSnapshots { if ps.ServerKey() == p.ServerKey() && ps.PlayerID() == p.PlayerID() && ps.Date().Equal(p.Date()) { - res[key] = append(res[key], i) + m[key] = append(m[key], i) } } } - for key, indexes := range res { + for key, indexes := range m { assert.Len(t, indexes, 1, key) } } diff --git a/internal/adapter/repository_tribe_change_test.go b/internal/adapter/repository_tribe_change_test.go index 41227a4..b232a8a 100644 --- a/internal/adapter/repository_tribe_change_test.go +++ b/internal/adapter/repository_tribe_change_test.go @@ -63,7 +63,7 @@ func testTribeChangeRepository(t *testing.T, newRepos func(t *testing.T) reposit tribeChanges, err := repos.tribeChange.List(ctx, listParams) require.NoError(t, err) - res := make(map[string][]int) + m := make(map[string][]int) for _, p := range params { key := fmt.Sprintf("%s-%d-%d-%d", p.ServerKey(), p.PlayerID(), p.OldTribeID(), p.NewTribeID()) @@ -71,12 +71,12 @@ func testTribeChangeRepository(t *testing.T, newRepos func(t *testing.T) reposit for i, tc := range tribeChanges { //nolint:lll if tc.ServerKey() == p.ServerKey() && tc.PlayerID() == p.PlayerID() && tc.OldTribeID() == p.OldTribeID() && tc.NewTribeID() == p.NewTribeID() { - res[key] = append(res[key], i) + m[key] = append(m[key], i) } } } - for key, indexes := range res { + for key, indexes := range m { assert.Len(t, indexes, 1, key) } } diff --git a/internal/adapter/repository_tribe_snapshot_test.go b/internal/adapter/repository_tribe_snapshot_test.go index 4bc475c..e88eeeb 100644 --- a/internal/adapter/repository_tribe_snapshot_test.go +++ b/internal/adapter/repository_tribe_snapshot_test.go @@ -65,19 +65,19 @@ func testTribeSnapshotRepository(t *testing.T, newRepos func(t *testing.T) repos tribeSnapshots, err := repos.tribeSnapshot.List(ctx, domain.NewListTribeSnapshotsParams()) require.NoError(t, err) - res := make(map[string][]int) + m := make(map[string][]int) for _, p := range params { key := fmt.Sprintf("%s-%d-%s", p.ServerKey(), p.TribeID(), p.Date().Format(dateFormat)) for i, ts := range tribeSnapshots { if ts.ServerKey() == p.ServerKey() && ts.TribeID() == p.TribeID() && ts.Date().Equal(p.Date()) { - res[key] = append(res[key], i) + m[key] = append(m[key], i) } } } - for key, indexes := range res { + for key, indexes := range m { assert.Len(t, indexes, 1, key) } } diff --git a/internal/service/snapshot_creation_test.go b/internal/service/snapshot_creation_test.go new file mode 100644 index 0000000..75cc1b2 --- /dev/null +++ b/internal/service/snapshot_creation_test.go @@ -0,0 +1,354 @@ +package service_test + +import ( + "context" + "fmt" + "os" + "os/signal" + "slices" + "syscall" + "testing" + "time" + + "gitea.dwysokinski.me/twhelp/corev3/internal/adapter" + "gitea.dwysokinski.me/twhelp/corev3/internal/app" + "gitea.dwysokinski.me/twhelp/corev3/internal/bun/buntest" + "gitea.dwysokinski.me/twhelp/corev3/internal/domain" + "gitea.dwysokinski.me/twhelp/corev3/internal/port" + "gitea.dwysokinski.me/twhelp/corev3/internal/watermill/watermillamqptest" + "gitea.dwysokinski.me/twhelp/corev3/internal/watermill/watermillmsg" + "gitea.dwysokinski.me/twhelp/corev3/internal/watermill/watermilltest" + "github.com/ThreeDotsLabs/watermill" + "github.com/ThreeDotsLabs/watermill-amqp/v2/pkg/amqp" + "github.com/brianvoe/gofakeit/v6" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSnapshotCreation(t *testing.T) { + t.Parallel() + + if testing.Short() { + t.Skip("skipping long-running test") + } + + ctxTimeout, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + ctx, stop := signal.NotifyContext(ctxTimeout, os.Interrupt, syscall.SIGTERM) + defer stop() + + // bun + db := postgres.NewDB(t) + buntest.NewFixture(db).Load(t, ctx, os.DirFS("./testdata/snapshotcreation"), "fixture.yml") + + // watermill + marshaler := watermillmsg.JSONMarshaler{NewUUID: watermill.NewUUID} + generateExchangeAndRoutingKeyName := func(topic string) string { + return topic + "_snapshots" + } + rmqConn := rabbitMQ.NewConnection(t) + nopLogger := watermill.NopLogger{} + _, serverSub := watermillamqptest.NewPubSub( + t, + rmqConn, + amqp.GenerateQueueNameTopicNameWithSuffix("_snapshots_server"), + generateExchangeAndRoutingKeyName, + ) + playerPub, playerSub := watermillamqptest.NewPubSub( + t, + rmqConn, + amqp.GenerateQueueNameTopicNameWithSuffix("_snapshots_player"), + generateExchangeAndRoutingKeyName, + ) + tribePub, tribeSub := watermillamqptest.NewPubSub( + t, + rmqConn, + amqp.GenerateQueueNameTopicNameWithSuffix("_snapshots_tribe"), + generateExchangeAndRoutingKeyName, + ) + + // events/commands + tribeSnapshotCmdCreate := gofakeit.UUID() + tribeSnapshotEventCreated := gofakeit.UUID() + playerSnapshotCmdCreate := gofakeit.UUID() + playerSnapshotEventCreated := gofakeit.UUID() + + // adapters + versionRepo := adapter.NewVersionBunRepository(db) + serverRepo := adapter.NewServerBunRepository(db) + tribeRepo := adapter.NewTribeBunRepository(db) + playerRepo := adapter.NewPlayerBunRepository(db) + tribeSnapshotRepo := adapter.NewTribeSnapshotBunRepository(db) + playerSnapshotRepo := adapter.NewPlayerSnapshotBunRepository(db) + tribeSnapshotPublisher := adapter.NewSnapshotWatermillPublisher( + tribePub, + marshaler, + tribeSnapshotCmdCreate, + tribeSnapshotEventCreated, + ) + playerSnapshotPublisher := adapter.NewSnapshotWatermillPublisher( + playerPub, + marshaler, + playerSnapshotCmdCreate, + playerSnapshotEventCreated, + ) + + // services + versionSvc := app.NewVersionService(versionRepo) + serverSvc := app.NewServerService(serverRepo, nil, nil) + tribeSvc := app.NewTribeService(tribeRepo, nil, nil) + playerSvc := app.NewPlayerService(playerRepo, nil, nil, nil) + tribeSnapshotSvc := app.NewTribeSnapshotService(tribeSnapshotRepo, tribeSvc, tribeSnapshotPublisher) + playerSnapshotSvc := app.NewPlayerSnapshotService(playerSnapshotRepo, playerSvc, playerSnapshotPublisher) + snapshotSvc := app.NewSnapshotService(versionSvc, serverSvc, tribeSnapshotPublisher, playerSnapshotPublisher) + + watermilltest.RunRouterWithContext( + t, + ctx, + port.NewServerWatermillConsumer( + serverSvc, + serverSub, + nopLogger, + marshaler, + "", + "", + "", + "", + "", + "", + tribeSnapshotEventCreated, + playerSnapshotEventCreated, + ), + port.NewPlayerWatermillConsumer( + nil, + playerSnapshotSvc, + playerSub, + nopLogger, + marshaler, + "", + playerSnapshotCmdCreate, + ), + port.NewTribeWatermillConsumer( + nil, + tribeSnapshotSvc, + tribeSub, + nopLogger, + marshaler, + "", + "", + tribeSnapshotCmdCreate, + ), + ) + + require.NoError(t, snapshotSvc.Create(ctx)) + + assert.EventuallyWithTf(t, func(collect *assert.CollectT) { + require.NoError(collect, ctx.Err()) + + listParams := domain.NewListServersParams() + require.NoError(collect, listParams.SetSort([]domain.ServerSort{ + domain.ServerSortKeyASC, + })) + require.NoError(collect, listParams.SetSpecial(domain.NullBool{ + Value: false, + Valid: true, + })) + require.NoError(collect, listParams.SetLimit(domain.ServerListMaxLimit)) + + for { + servers, err := serverRepo.List(ctx, listParams) + require.NoError(collect, err) + + if len(servers) == 0 { + return + } + + for _, s := range servers { + assert.WithinDuration(collect, time.Now(), s.PlayerSnapshotsCreatedAt(), time.Minute, s.Key()) + assert.WithinDuration(collect, time.Now(), s.TribeSnapshotsCreatedAt(), time.Minute, s.Key()) + } + + require.NoError(collect, listParams.SetKeyGT(domain.NullString{ + Value: servers[len(servers)-1].Key(), + Valid: true, + })) + } + }, 30*time.Second, 500*time.Millisecond, "servers") + + assert.EventuallyWithTf(t, func(collect *assert.CollectT) { + require.NoError(collect, ctx.Err()) + + listTribesParams := domain.NewListTribesParams() + require.NoError(collect, listTribesParams.SetSort([]domain.TribeSort{ + domain.TribeSortServerKeyASC, + domain.TribeSortIDASC, + })) + require.NoError(collect, listTribesParams.SetDeleted(domain.NullBool{ + Value: false, + Valid: true, + })) + require.NoError(collect, listTribesParams.SetLimit(domain.TribeListMaxLimit)) + + var allTribes domain.Tribes + + for { + tribes, err := tribeRepo.List(ctx, listTribesParams) + require.NoError(collect, err) + + if len(tribes) == 0 { + break + } + + allTribes = append(allTribes, tribes...) + + require.NoError(collect, listTribesParams.SetIDGT(domain.NullInt{ + Value: tribes[len(tribes)-1].ID(), + Valid: true, + })) + } + + listSnapshotsParams := domain.NewListTribeSnapshotsParams() + require.NoError(collect, listSnapshotsParams.SetSort([]domain.TribeSnapshotSort{ + domain.TribeSnapshotSortServerKeyASC, + domain.TribeSnapshotSortDateASC, + domain.TribeSnapshotSortIDASC, + })) + require.NoError(collect, listSnapshotsParams.SetLimit(domain.TribeSnapshotListMaxLimit)) + + cnt := 0 + + for { + snapshots, err := tribeSnapshotRepo.List(ctx, listSnapshotsParams) + require.NoError(collect, err) + + if len(snapshots) == 0 { + break + } + + for _, ts := range snapshots { + cnt++ + msg := fmt.Sprintf("TribeID=%d,ServerKey=%s", ts.TribeID(), ts.ServerKey()) + + idx := slices.IndexFunc(allTribes, func(t domain.Tribe) bool { + return t.ID() == ts.TribeID() && t.ServerKey() == ts.ServerKey() + }) + if !assert.GreaterOrEqual( + collect, + idx, + 0, + msg, + ) { + continue + } + + tribe := allTribes[idx] + + assert.NotZero(collect, ts.ID(), msg) + assert.Equal(collect, tribe.ID(), ts.TribeID(), msg) + assert.Equal(collect, tribe.ServerKey(), ts.ServerKey(), msg) + assert.Equal(collect, tribe.NumMembers(), ts.NumMembers(), msg) + assert.Equal(collect, tribe.NumVillages(), ts.NumVillages(), msg) + assert.Equal(collect, tribe.Points(), ts.Points(), msg) + assert.Equal(collect, tribe.AllPoints(), ts.AllPoints(), msg) + assert.Equal(collect, tribe.Rank(), ts.Rank(), msg) + assert.Equal(collect, tribe.OD(), ts.OD(), msg) + assert.InDelta(collect, tribe.Dominance(), ts.Dominance(), 0.001, msg) + assert.WithinDuration(collect, time.Now(), ts.CreatedAt(), time.Minute, msg) + assert.WithinDuration(collect, time.Now(), ts.Date(), 24*time.Hour, msg) + } + + require.NoError(collect, listSnapshotsParams.SetOffset(listSnapshotsParams.Offset()+listSnapshotsParams.Limit())) + } + + //nolint:testifylint + assert.Equal(collect, len(allTribes), cnt) + }, 30*time.Second, 500*time.Millisecond, "tribes") + + assert.EventuallyWithTf(t, func(collect *assert.CollectT) { + require.NoError(collect, ctx.Err()) + + listPlayersParams := domain.NewListPlayersParams() + require.NoError(collect, listPlayersParams.SetSort([]domain.PlayerSort{ + domain.PlayerSortServerKeyASC, + domain.PlayerSortIDASC, + })) + require.NoError(collect, listPlayersParams.SetDeleted(domain.NullBool{ + Value: false, + Valid: true, + })) + require.NoError(collect, listPlayersParams.SetLimit(domain.PlayerListMaxLimit)) + + var allPlayers domain.Players + + for { + players, err := playerRepo.List(ctx, listPlayersParams) + require.NoError(collect, err) + + if len(players) == 0 { + break + } + + allPlayers = append(allPlayers, players...) + + require.NoError(collect, listPlayersParams.SetIDGT(domain.NullInt{ + Value: players[len(players)-1].ID(), + Valid: true, + })) + } + + listSnapshotsParams := domain.NewListPlayerSnapshotsParams() + require.NoError(collect, listSnapshotsParams.SetSort([]domain.PlayerSnapshotSort{ + domain.PlayerSnapshotSortServerKeyASC, + domain.PlayerSnapshotSortDateASC, + domain.PlayerSnapshotSortIDASC, + })) + require.NoError(collect, listSnapshotsParams.SetLimit(domain.PlayerSnapshotListMaxLimit)) + + cnt := 0 + + for { + snapshots, err := playerSnapshotRepo.List(ctx, listSnapshotsParams) + require.NoError(collect, err) + + if len(snapshots) == 0 { + break + } + + for _, ps := range snapshots { + cnt++ + msg := fmt.Sprintf("PlayerID=%d,ServerKey=%s", ps.PlayerID(), ps.ServerKey()) + + idx := slices.IndexFunc(allPlayers, func(p domain.Player) bool { + return p.ID() == ps.PlayerID() && p.ServerKey() == ps.ServerKey() + }) + if !assert.GreaterOrEqual( + collect, + idx, + 0, + msg, + ) { + continue + } + + player := allPlayers[idx] + + assert.NotZero(collect, ps.ID(), msg) + assert.Equal(collect, player.ID(), ps.PlayerID(), msg) + assert.Equal(collect, player.ServerKey(), ps.ServerKey(), msg) + assert.Equal(collect, player.NumVillages(), ps.NumVillages(), msg) + assert.Equal(collect, player.Points(), ps.Points(), msg) + assert.Equal(collect, player.Rank(), ps.Rank(), msg) + assert.Equal(collect, player.TribeID(), ps.TribeID(), msg) + assert.Equal(collect, player.OD(), ps.OD(), msg) + assert.WithinDuration(collect, time.Now(), ps.CreatedAt(), time.Minute, msg) + assert.WithinDuration(collect, time.Now(), ps.Date(), 24*time.Hour, msg) + } + + require.NoError(collect, listSnapshotsParams.SetOffset(listSnapshotsParams.Offset()+listSnapshotsParams.Limit())) + } + + //nolint:testifylint + assert.Equal(collect, len(allPlayers), cnt) + }, 30*time.Second, 500*time.Millisecond, "players") +} diff --git a/internal/service/testdata/snapshotcreation/fixture.yml b/internal/service/testdata/snapshotcreation/fixture.yml new file mode 100644 index 0000000..32c413a --- /dev/null +++ b/internal/service/testdata/snapshotcreation/fixture.yml @@ -0,0 +1,1151 @@ +- model: Server + rows: + - _id: pl169 + key: pl169 + url: https://pl169.plemiona.pl + open: true + special: false + num_players: 2001 + num_tribes: 214 + num_villages: 49074 + num_player_villages: 48500 + num_barbarian_villages: 1574 + num_bonus_villages: 2048 + created_at: 2022-03-19T12:01:39.000Z + player_data_updated_at: 2022-03-19T12:01:39.000Z + player_snapshots_created_at: 2022-03-19T12:01:39.000Z + tribe_data_updated_at: 2022-03-19T12:01:39.000Z + tribe_snapshots_created_at: 2022-03-19T12:01:39.000Z + village_data_updated_at: 2022-03-19T12:01:39.000Z + ennoblement_data_updated_at: 2022-03-19T12:01:39.000Z + version_code: pl +- model: Tribe + rows: + - rank_att: 1 + score_att: 669292167 + rank_def: 5 + score_def: 199124128 + rank_sup: 0 + score_sup: 0 + rank_total: 2 + score_total: 868416295 + _id: pl169-csa + id: 28 + server_key: pl169 + name: Konfederacja + tag: CSA. + num_members: 66 + num_villages: 14480 + points: 114277979 + all_points: 143350058 + rank: 1 + dominance: 29.76912481240106 + created_at: 2021-09-02T23:01:13.000Z + profile_url: https://pl169.plemiona.pl/game.php?screen=info_ally&id=28 + - rank_att: 3 + score_att: 358150686 + rank_def: 3 + score_def: 331975367 + rank_sup: 0 + score_sup: 0 + rank_total: 4 + score_total: 690126053 + _id: pl169-csa-jr + id: 2 + server_key: pl169 + name: KONFEDERACJA JUNIOR + tag: CSA.JR + num_members: 53 + num_villages: 10752 + points: 97684589 + all_points: 105576587 + rank: 2 + dominance: 22.10480870047902 + created_at: 2021-09-02T18:01:08.000Z + profile_url: https://pl169.plemiona.pl/game.php?screen=info_ally&id=2 + - rank_att: 2 + score_att: 513902873 + rank_def: 6 + score_def: 177660231 + rank_sup: 0 + score_sup: 0 + rank_total: 3 + score_total: 691563104 + _id: pl169-kuzyni + id: 27 + server_key: pl169 + name: Spoceni Kuzyni + tag: KUZYNI + num_members: 52 + num_villages: 10152 + points: 91951132 + all_points: 97812820 + rank: 3 + dominance: 20.87128142924693 + created_at: 2021-09-02T22:00:37.000Z + profile_url: https://pl169.plemiona.pl/game.php?screen=info_ally&id=27 + - rank_att: 4 + score_att: 228636414 + rank_def: 1 + score_def: 865423891 + rank_sup: 0 + score_sup: 0 + rank_total: 1 + score_total: 1094060305 + _id: pl169-lpk + id: 1 + server_key: pl169 + name: Łapanka + tag: ŁPK + num_members: 61 + num_villages: 3471 + points: 28417793 + all_points: 30608034 + rank: 4 + dominance: 7.13595526407763 + created_at: 2021-09-02T18:01:08.000Z + profile_url: https://pl169.plemiona.pl/game.php?screen=info_ally&id=1 + - rank_att: 5 + score_att: 163168564 + rank_def: 13 + score_def: 60229489 + rank_sup: 0 + score_sup: 0 + rank_total: 7 + score_total: 223398053 + _id: pl169-tt + id: 122 + server_key: pl169 + name: TIP TOP + tag: TT. + num_members: 23 + num_villages: 908 + points: 8188040 + all_points: 8188040 + rank: 6 + dominance: 1.8667379371312267 + created_at: 2021-09-08T02:00:58.000Z + deleted_at: 2022-09-08T02:00:58.000Z + profile_url: https://pl169.plemiona.pl/game.php?screen=info_ally&id=122 +- model: Player + rows: + - rank_att: 5 + score_att: 38213157 + rank_def: 2 + score_def: 51137731 + rank_sup: 104 + score_sup: 2282683 + rank_total: 1 + score_total: 91633571 + id: 6180190 + server_key: pl169 + name: Chcesz remont? + num_villages: 665 + points: 7298055 + rank: 1 + tribe_id: 27 + created_at: 2021-09-02T21:01:03Z + profile_url: https://www.chiefmesh.info/sexy + - rank_att: 13 + score_att: 23124653 + rank_def: 112 + score_def: 5547007 + rank_sup: 10 + score_sup: 10651344 + rank_total: 23 + score_total: 39323004 + id: 8419570 + server_key: pl169 + name: Maddov + num_villages: 643 + points: 6292398 + rank: 2 + tribe_id: 2 + created_at: 2021-09-08T20:01:11Z + profile_url: https://www.corporatemarkets.net/bandwidth/e-enable/value-added/granular + - rank_att: 4 + score_att: 41520479 + rank_def: 64 + score_def: 9766745 + rank_sup: 202 + score_sup: 1221233 + rank_total: 13 + score_total: 52508457 + id: 699736927 + server_key: pl169 + name: Bociarze + num_villages: 561 + points: 5800404 + rank: 3 + tribe_id: 27 + created_at: 2021-09-04T15:01:18Z + profile_url: http://www.humancontent.org/deliver/recontextualize/action-items + - rank_att: 3 + score_att: 45122465 + rank_def: 55 + score_def: 11279384 + rank_sup: 44 + score_sup: 4610447 + rank_total: 6 + score_total: 61012296 + id: 6681652 + server_key: pl169 + name: 83ania83 x Radwalk3 + num_villages: 573 + points: 5763174 + rank: 4 + tribe_id: 28 + created_at: 2021-09-02T23:01:13Z + profile_url: https://www.productsolutions.com/seamless/e-services/24-365 + - rank_att: 12 + score_att: 24408591 + rank_def: 153 + score_def: 4005341 + rank_sup: 92 + score_sup: 2512348 + rank_total: 36 + score_total: 30926280 + id: 849014922 + server_key: pl169 + name: Tomasz Łomot + num_villages: 529 + points: 5225098 + rank: 5 + tribe_id: 27 + created_at: 2021-09-16T23:00:54Z + profile_url: http://www.nationalpartnerships.com/front-end/reinvent/mesh + - rank_att: 26 + score_att: 15992358 + rank_def: 51 + score_def: 12218121 + rank_sup: 369 + score_sup: 432857 + rank_total: 43 + score_total: 28643336 + id: 8503549 + server_key: pl169 + name: iwan.23.2 + num_villages: 511 + points: 5091810 + rank: 6 + tribe_id: 2 + created_at: 2021-09-08T19:01:03Z + profile_url: https://www.futureweb-enabled.info/seize/24-365/grow + - rank_att: 2 + score_att: 45411371 + rank_def: 175 + score_def: 3581020 + rank_sup: 34 + score_sup: 5158633 + rank_total: 11 + score_total: 54151024 + id: 699513260 + server_key: pl169 + name: Combobombo + num_villages: 518 + points: 5020701 + rank: 7 + tribe_id: 27 + created_at: 2021-09-06T14:00:53Z + profile_url: https://www.futureplatforms.org/back-end/mission-critical/unleash/implement + - rank_att: 7 + score_att: 28659400 + rank_def: 77 + score_def: 8179981 + rank_sup: 78 + score_sup: 3142156 + rank_total: 22 + score_total: 39981537 + id: 848915730 + server_key: pl169 + name: szunaj23 + num_villages: 514 + points: 5015401 + rank: 8 + tribe_id: 28 + created_at: 2021-09-08T11:01:09Z + profile_url: https://www.districtsolutions.com/e-business/maximize/synthesize/convergence + - rank_att: 1 + score_att: 50470345 + rank_def: 67 + score_def: 9376505 + rank_sup: 380 + score_sup: 408385 + rank_total: 7 + score_total: 60255235 + id: 9299539 + server_key: pl169 + name: DefinitelyRlyTheD0orek + num_villages: 486 + points: 4865171 + rank: 9 + tribe_id: 28 + created_at: 2021-09-02T23:01:13Z + profile_url: http://www.forwardutilize.name/embrace/markets/architect/one-to-one + - rank_att: 30 + score_att: 14418054 + rank_def: 33 + score_def: 17634862 + rank_sup: 17 + score_sup: 8491667 + rank_total: 20 + score_total: 40544583 + id: 699783765 + server_key: pl169 + name: xKentinPL + num_villages: 433 + points: 4427826 + rank: 10 + tribe_id: 28 + created_at: 2021-09-05T23:01:02Z + profile_url: https://www.directholistic.biz/disintermediate + - rank_att: 20 + score_att: 18178345 + rank_def: 198 + score_def: 3148247 + rank_sup: 321 + score_sup: 578830 + rank_total: 61 + score_total: 21905422 + id: 699072129 + server_key: pl169 + name: Charfa + num_villages: 417 + points: 4289852 + rank: 11 + tribe_id: 28 + created_at: 2021-09-15T08:01:13Z + profile_url: https://www.humandeliver.biz/front-end/eyeballs/visionary + - rank_att: 6 + score_att: 30513732 + rank_def: 36 + score_def: 15912636 + rank_sup: 221 + score_sup: 1051156 + rank_total: 15 + score_total: 47477524 + id: 699491076 + server_key: pl169 + name: DaSilva2402 + num_villages: 423 + points: 4176778 + rank: 12 + tribe_id: 28 + created_at: 2021-09-02T19:01:08Z + profile_url: http://www.directcustomized.biz/iterate/aggregate/convergence + - rank_att: 25 + score_att: 16186476 + rank_def: 14 + score_def: 29254203 + rank_sup: 25 + score_sup: 6273448 + rank_total: 14 + score_total: 51714127 + id: 699697558 + server_key: pl169 + name: Deveste + num_villages: 382 + points: 4066267 + rank: 13 + tribe_id: 28 + created_at: 2021-09-03T21:00:57Z + profile_url: https://www.leadcutting-edge.name/24-365/users/platforms + - rank_att: 184 + score_att: 3617056 + rank_def: 253 + score_def: 2171843 + rank_sup: 1 + score_sup: 25054213 + rank_total: 37 + score_total: 30843112 + id: 8099868 + server_key: pl169 + name: Brown + num_villages: 413 + points: 3945400 + rank: 14 + tribe_id: 27 + created_at: 2021-09-05T13:01:06Z + profile_url: https://www.chiefinitiatives.org/applications/benchmark/action-items/enterprise + - rank_att: 8 + score_att: 28069010 + rank_def: 76 + score_def: 8193976 + rank_sup: 146 + score_sup: 1743707 + rank_total: 24 + score_total: 38006693 + id: 8895532 + server_key: pl169 + name: KubekXD11 + num_villages: 376 + points: 3923741 + rank: 15 + tribe_id: 28 + created_at: 2021-09-06T10:00:55Z + profile_url: https://www.regionalmindshare.name/infomediaries/matrix/reintermediate + - rank_att: 14 + score_att: 22622696 + rank_def: 109 + score_def: 5581974 + rank_sup: 30 + score_sup: 5540240 + rank_total: 30 + score_total: 33744910 + id: 848956765 + server_key: pl169 + name: Fristajla + num_villages: 393 + points: 3886905 + rank: 16 + tribe_id: 28 + created_at: 2021-09-02T23:01:13Z + profile_url: http://www.forwardrecontextualize.net/models + - rank_att: 10 + score_att: 26740200 + rank_def: 75 + score_def: 8418370 + rank_sup: 166 + score_sup: 1498855 + rank_total: 26 + score_total: 36657425 + id: 699722599 + server_key: pl169 + name: Sandre + num_villages: 359 + points: 3670115 + rank: 17 + tribe_id: 2 + created_at: 2021-09-21T19:01:08Z + profile_url: https://www.forwardevolve.io/incubate + - rank_att: 45 + score_att: 11478083 + rank_def: 99 + score_def: 6319339 + rank_sup: 53 + score_sup: 4056681 + rank_total: 62 + score_total: 21854103 + id: 9236866 + server_key: pl169 + name: notfair. + num_villages: 355 + points: 3664235 + rank: 18 + tribe_id: 2 + created_at: 2021-09-02T18:01:08Z + profile_url: http://www.regionalreal-time.com/bleeding-edge/cross-platform + - rank_att: 11 + score_att: 24697368 + rank_def: 74 + score_def: 8527147 + rank_sup: 52 + score_sup: 4094576 + rank_total: 25 + score_total: 37319091 + id: 415911 + server_key: pl169 + name: Kuzyn Tymoteusz + num_villages: 366 + points: 3646744 + rank: 19 + tribe_id: 27 + created_at: 2021-09-04T18:01:01Z + profile_url: https://www.customernetworks.net/productize/syndicate/strategize + - rank_att: 17 + score_att: 20015514 + rank_def: 221 + score_def: 2708913 + rank_sup: 269 + score_sup: 819646 + rank_total: 59 + score_total: 23544073 + id: 698906963 + server_key: pl169 + name: Xerios + num_villages: 337 + points: 3490102 + rank: 20 + tribe_id: 2 + created_at: 2021-09-18T09:00:56Z + profile_url: https://www.futuree-enable.name/revolutionize/visionary/scale/seamless + - rank_att: 28 + score_att: 15377024 + rank_def: 84 + score_def: 7271205 + rank_sup: 154 + score_sup: 1615041 + rank_total: 54 + score_total: 24263270 + id: 9291984 + server_key: pl169 + name: Alessaandra + num_villages: 348 + points: 3488262 + rank: 21 + tribe_id: 28 + created_at: 2021-09-02T21:01:03Z + profile_url: https://www.productvisionary.name/integrate + - rank_att: 21 + score_att: 17745150 + rank_def: 46 + score_def: 12745616 + rank_sup: 133 + score_sup: 1900033 + rank_total: 32 + score_total: 32390799 + id: 698971484 + server_key: pl169 + name: ryju15 + num_villages: 311 + points: 3449908 + rank: 22 + tribe_id: 2 + created_at: 2021-09-04T16:00:52Z + profile_url: https://www.corporate24-365.biz/out-of-the-box + - rank_att: 16 + score_att: 20711344 + rank_def: 69 + score_def: 9001912 + rank_sup: 136 + score_sup: 1853257 + rank_total: 35 + score_total: 31566513 + id: 848955783 + server_key: pl169 + name: Bucks + num_villages: 327 + points: 3395812 + rank: 23 + tribe_id: 2 + created_at: 2021-09-03T16:01:02Z + profile_url: https://www.chiefinnovate.name/integrated/24-365/applications + - rank_att: 23 + score_att: 17516132 + rank_def: 53 + score_def: 11661026 + rank_sup: 278 + score_sup: 755974 + rank_total: 40 + score_total: 29933132 + id: 698708739 + server_key: pl169 + name: Redram + num_villages: 316 + points: 3365970 + rank: 25 + tribe_id: 2 + created_at: 2021-09-03T04:01:08Z + profile_url: http://www.legacyplug-and-play.biz/channels + - rank_att: 59 + score_att: 9984179 + rank_def: 189 + score_def: 3366915 + rank_sup: 47 + score_sup: 4440024 + rank_total: 75 + score_total: 17791118 + id: 698962117 + server_key: pl169 + name: pawcio231 + num_villages: 360 + points: 3327315 + rank: 26 + tribe_id: 28 + created_at: 2021-09-08T23:01:10Z + profile_url: https://www.directtransform.name/systems/niches/portals/orchestrate + - rank_att: 41 + score_att: 11776916 + rank_def: 160 + score_def: 3868385 + rank_sup: 141 + score_sup: 1793667 + rank_total: 77 + score_total: 17438968 + id: 699568529 + server_key: pl169 + name: Bujaki TOP + num_villages: 329 + points: 3245020 + rank: 27 + tribe_id: 2 + created_at: 2021-09-08T07:00:56Z + profile_url: http://www.nationalseamless.name/compelling/target/applications + - rank_att: 90 + score_att: 7365720 + rank_def: 173 + score_def: 3613084 + rank_sup: 161 + score_sup: 1524281 + rank_total: 138 + score_total: 12503085 + id: 3698627 + server_key: pl169 + name: Bystek7 + num_villages: 304 + points: 3169124 + rank: 28 + tribe_id: 28 + created_at: 2021-09-02T22:00:37Z + profile_url: http://www.human24-7.biz/exploit/target + - rank_att: 34 + score_att: 12659615 + rank_def: 37 + score_def: 15629531 + rank_sup: 138 + score_sup: 1829993 + rank_total: 39 + score_total: 30119139 + id: 699856962 + server_key: pl169 + name: Suppx + num_villages: 317 + points: 3153337 + rank: 29 + tribe_id: 2 + created_at: 2021-09-02T20:00:41Z + profile_url: http://www.internationale-services.org/implement + - rank_att: 53 + score_att: 10505715 + rank_def: 162 + score_def: 3807741 + rank_sup: 93 + score_sup: 2505042 + rank_total: 86 + score_total: 16818498 + id: 698490958 + server_key: pl169 + name: dzymi3 + num_villages: 291 + points: 3139702 + rank: 30 + tribe_id: 2 + created_at: 2021-09-17T14:01:06Z + profile_url: https://www.directreintermediate.org/systems/incentivize/eyeballs/technologies + - rank_att: 27 + score_att: 15494779 + rank_def: 200 + score_def: 3121085 + rank_sup: 261 + score_sup: 837952 + rank_total: 69 + score_total: 19453816 + id: 2714827 + server_key: pl169 + name: George74 + num_villages: 306 + points: 3123682 + rank: 31 + tribe_id: 28 + created_at: 2021-09-08T19:01:03Z + profile_url: https://www.dynamicmission-critical.com/monetize/expedite/generate + - rank_att: 48 + score_att: 11099498 + rank_def: 145 + score_def: 4123425 + rank_sup: 127 + score_sup: 1950725 + rank_total: 82 + score_total: 17173648 + id: 699088769 + server_key: pl169 + name: Before1995 + num_villages: 316 + points: 3088801 + rank: 32 + tribe_id: 28 + created_at: 2021-09-09T15:01:07Z + profile_url: http://www.legacyintegrate.net/b2b/monetize/brand + - rank_att: 46 + score_att: 11253371 + rank_def: 190 + score_def: 3334172 + rank_sup: 226 + score_sup: 1035204 + rank_total: 102 + score_total: 15622747 + id: 699431255 + server_key: pl169 + name: MacioB1997 + num_villages: 298 + points: 3074325 + rank: 33 + tribe_id: 28 + created_at: 2021-09-07T20:00:57Z + profile_url: https://www.legacyaggregate.name/paradigms/global/communities/systems + - rank_att: 71 + score_att: 8808437 + rank_def: 357 + score_def: 1243861 + rank_sup: 122 + score_sup: 1980506 + rank_total: 142 + score_total: 12032804 + id: 699402816 + server_key: pl169 + name: Luxipux + num_villages: 304 + points: 3064296 + rank: 34 + tribe_id: 28 + created_at: 2021-09-02T19:01:08Z + profile_url: http://www.customerfunctionalities.org/extend/benchmark/best-of-breed/real-time + - rank_att: 72 + score_att: 8759698 + rank_def: 361 + score_def: 1201078 + rank_sup: 132 + score_sup: 1913600 + rank_total: 145 + score_total: 11874376 + id: 848978290 + server_key: pl169 + name: krysian997 + num_villages: 353 + points: 3017347 + rank: 35 + tribe_id: 27 + created_at: 2021-09-02T19:01:08Z + profile_url: https://www.legacyuser-centric.com/rich/frictionless/leverage + - rank_att: 49 + score_att: 10949751 + rank_def: 107 + score_def: 5738387 + rank_sup: 91 + score_sup: 2514722 + rank_total: 71 + score_total: 19202860 + id: 9280477 + server_key: pl169 + name: Kampaj3 + num_villages: 300 + points: 2964624 + rank: 36 + tribe_id: 27 + created_at: 2021-09-08T11:01:09Z + profile_url: https://www.forwardoptimize.biz/integrated + - rank_att: 117 + score_att: 5974016 + rank_def: 260 + score_def: 2061724 + rank_sup: 172 + score_sup: 1471296 + rank_total: 184 + score_total: 9507036 + id: 3911024 + server_key: pl169 + name: sebaqwe97 + num_villages: 279 + points: 2953426 + rank: 37 + tribe_id: 28 + created_at: 2021-09-08T19:01:03Z + profile_url: http://www.forwardmagnetic.io/scalable + - rank_att: 61 + score_att: 9572967 + rank_def: 248 + score_def: 2250978 + rank_sup: 8 + score_sup: 12492735 + rank_total: 53 + score_total: 24316680 + id: 848972489 + server_key: pl169 + name: K4miru + num_villages: 297 + points: 2961589 + rank: 38 + tribe_id: 2 + created_at: 2021-09-04T20:00:59Z + profile_url: https://www.productarchitect.com/back-end/e-enable + - rank_att: 75 + score_att: 8615717 + rank_def: 271 + score_def: 1929852 + rank_sup: 43 + score_sup: 4684436 + rank_total: 107 + score_total: 15230005 + id: 698152377 + server_key: pl169 + name: mackobl14 + num_villages: 282 + points: 2932284 + rank: 39 + tribe_id: 28 + created_at: 2021-09-17T11:00:56Z + profile_url: https://www.dynamicutilize.com/paradigms + - rank_att: 78 + score_att: 8307266 + rank_def: 73 + score_def: 8661273 + rank_sup: 394 + score_sup: 369095 + rank_total: 79 + score_total: 17337634 + id: 699343374 + server_key: pl169 + name: wezu + num_villages: 309 + points: 2847379 + rank: 40 + tribe_id: 2 + created_at: 2021-10-10T07:00:56Z + profile_url: https://www.futurecompelling.biz/utilize/generate/metrics/interactive + - rank_att: 96 + score_att: 6896050 + rank_def: 280 + score_def: 1837049 + rank_sup: 102 + score_sup: 2338774 + rank_total: 156 + score_total: 11071873 + id: 699405597 + server_key: pl169 + name: Dobrodziej I Wspaniały + num_villages: 292 + points: 2845687 + rank: 41 + tribe_id: 27 + created_at: 2021-09-13T20:01:12Z + profile_url: https://www.dynamicvisualize.org/mindshare/recontextualize + - rank_att: 94 + score_att: 7140798 + rank_def: 323 + score_def: 1438578 + rank_sup: 131 + score_sup: 1926787 + rank_total: 168 + score_total: 10506163 + id: 9264752 + server_key: pl169 + name: Hitman003 + num_villages: 275 + points: 2841597 + rank: 42 + tribe_id: 27 + created_at: 2021-09-06T20:01:11Z + profile_url: https://www.forwardutilize.info/visionary/partnerships/harness/streamline + - rank_att: 99 + score_att: 6746116 + rank_def: 466 + score_def: 803635 + rank_sup: 148 + score_sup: 1677633 + rank_total: 191 + score_total: 9227384 + id: 8630972 + server_key: pl169 + name: PijaniiBracia + num_villages: 294 + points: 2814452 + rank: 43 + tribe_id: 28 + created_at: 2021-09-07T20:00:57Z + profile_url: http://www.districtdrive.org/impactful/whiteboard/benchmark + - rank_att: 29 + score_att: 14916881 + rank_def: 105 + score_def: 5823896 + rank_sup: 63 + score_sup: 3706945 + rank_total: 52 + score_total: 24447722 + id: 699779632 + server_key: pl169 + name: Japczan + num_villages: 281 + points: 2755427 + rank: 44 + tribe_id: 27 + created_at: 2021-09-22T23:01:04Z + profile_url: https://www.dynamicplatforms.io/user-centric/engage/metrics + - rank_att: 79 + score_att: 8228366 + rank_def: 242 + score_def: 2437194 + rank_sup: 15 + score_sup: 8755547 + rank_total: 70 + score_total: 19421107 + id: 8399822 + server_key: pl169 + name: Future Traveler + num_villages: 273 + points: 2745538 + rank: 45 + tribe_id: 2 + created_at: 2021-09-03T11:01:05Z + profile_url: https://www.nationalseize.biz/holistic/applications/facilitate/embrace + - rank_att: 110 + score_att: 6241797 + rank_def: 220 + score_def: 2711454 + rank_sup: 297 + score_sup: 662200 + rank_total: 181 + score_total: 9615451 + id: 698290577 + server_key: pl169 + name: Mercel + num_villages: 275 + points: 2725295 + rank: 46 + tribe_id: 28 + created_at: 2021-09-08T17:01:03Z + profile_url: https://www.districtsynergistic.org/architect/e-business + - rank_att: 15 + score_att: 21852306 + rank_def: 316 + score_def: 1495404 + rank_sup: 317 + score_sup: 587716 + rank_total: 55 + score_total: 23935426 + id: 1990750 + server_key: pl169 + name: xkikutx + num_villages: 264 + points: 2675924 + rank: 47 + tribe_id: 28 + created_at: 2021-09-13T18:01:10Z + profile_url: https://www.internaldeliver.io/solutions/revolutionize/applications + - rank_att: 9 + score_att: 26795962 + rank_def: 236 + score_def: 2536394 + rank_sup: 77 + score_sup: 3149890 + rank_total: 31 + score_total: 32482246 + id: 848961308 + server_key: pl169 + name: Brisingr + num_villages: 275 + points: 2604285 + rank: 48 + tribe_id: 27 + created_at: 2021-09-04T18:01:01Z + profile_url: https://www.investorgrow.name/paradigms/holistic + - rank_att: 47 + score_att: 11123250 + rank_def: 119 + score_def: 5088387 + rank_sup: 270 + score_sup: 790678 + rank_total: 85 + score_total: 17002315 + id: 699604515 + server_key: pl169 + name: KruliK + num_villages: 265 + points: 2542323 + rank: 49 + tribe_id: 27 + created_at: 2021-09-03T13:01:02Z + profile_url: http://www.districte-business.biz/cutting-edge/e-enable/leading-edge + - rank_att: 32 + score_att: 13698775 + rank_def: 469 + score_def: 797904 + rank_sup: 220 + score_sup: 1069456 + rank_total: 104 + score_total: 15566135 + id: 6229439 + server_key: pl169 + name: Farmier und Mroczny + num_villages: 253 + points: 2526824 + rank: 50 + tribe_id: 28 + created_at: 2021-09-06T19:01:01Z + profile_url: http://www.leadcutting-edge.com/schemas/customized/markets + - rank_att: 55 + score_att: 10342920 + rank_def: 358 + score_def: 1238308 + rank_sup: 182 + score_sup: 1355872 + rank_total: 130 + score_total: 12937100 + id: 699854484 + server_key: pl169 + name: DonSzwagreone + num_villages: 265 + points: 2513259 + rank: 51 + tribe_id: 2 + created_at: 2021-09-08T12:01:04Z + profile_url: http://www.internationalextensible.io/orchestrate/e-services/exploit/embrace + - rank_att: 24 + score_att: 17213216 + rank_def: 492 + score_def: 731336 + rank_sup: 195 + score_sup: 1246179 + rank_total: 72 + score_total: 19190731 + id: 699532087 + server_key: pl169 + name: kicka14 + num_villages: 250 + points: 2492871 + rank: 52 + tribe_id: 28 + created_at: 2021-09-12T18:01:02Z + profile_url: https://www.dynamicend-to-end.biz/optimize/empower + - rank_att: 57 + score_att: 10210665 + rank_def: 404 + score_def: 1018965 + rank_sup: 98 + score_sup: 2401529 + rank_total: 119 + score_total: 13631159 + id: 699636650 + server_key: pl169 + name: jeku + num_villages: 245 + points: 2457975 + rank: 53 + tribe_id: 2 + created_at: 2021-09-02T19:01:08Z + profile_url: http://www.humanexpedite.net/generate/transition + - rank_att: 43 + score_att: 11592425 + rank_def: 336 + score_def: 1360540 + rank_sup: 176 + score_sup: 1443330 + rank_total: 113 + score_total: 14396295 + id: 7491093 + server_key: pl169 + name: nubeN + num_villages: 243 + points: 2421335 + rank: 54 + tribe_id: 28 + created_at: 2021-09-02T22:00:37Z + profile_url: https://www.legacyopen-source.biz/plug-and-play/visualize/streamline/e-business + - rank_att: 50 + score_att: 10855472 + rank_def: 366 + score_def: 1176566 + rank_sup: 282 + score_sup: 735814 + rank_total: 132 + score_total: 12767852 + id: 699680504 + server_key: pl169 + name: asd.sa + num_villages: 241 + points: 2392853 + rank: 55 + tribe_id: 28 + created_at: 2021-09-13T06:01:16Z + profile_url: http://www.globalsynergize.com/scalable + - rank_att: 188 + score_att: 3525019 + rank_def: 184 + score_def: 3435294 + rank_sup: 65 + score_sup: 3650793 + rank_total: 166 + score_total: 10611106 + id: 698695052 + server_key: pl169 + name: WeeBuuś + num_villages: 232 + points: 2390703 + rank: 56 + tribe_id: 2 + created_at: 2021-09-09T16:00:56Z + profile_url: https://www.dynamice-business.name/innovative/networks + - rank_att: 18 + score_att: 19485744 + rank_def: 343 + score_def: 1330152 + rank_sup: 267 + score_sup: 828055 + rank_total: 63 + score_total: 21643951 + id: 699401725 + server_key: pl169 + name: Dziki zwierzz + num_villages: 254 + points: 2371168 + rank: 57 + tribe_id: 27 + created_at: 2021-09-03T17:00:59Z + profile_url: https://www.chiefharness.org/engineer + - rank_att: 104 + score_att: 6543106 + rank_def: 115 + score_def: 5250069 + rank_sup: 187 + score_sup: 1314359 + rank_total: 126 + score_total: 13107534 + id: 698588535 + server_key: pl169 + name: krismal + num_villages: 250 + points: 2353479 + rank: 58 + tribe_id: 28 + created_at: 2021-09-05T09:01:22Z + profile_url: https://www.humanbrand.name/synthesize + - rank_att: 31 + score_att: 14057243 + rank_def: 13 + score_def: 30682357 + rank_sup: 120 + score_sup: 2003339 + rank_total: 16 + score_total: 46742939 + id: 698312136 + server_key: pl169 + name: Shotasik + num_villages: 234 + points: 2344553 + rank: 59 + tribe_id: 2 + created_at: 2021-09-08T15:01:08Z + profile_url: http://www.nationalarchitect.io/productize/dot-com + - rank_att: 135 + score_att: 5329146 + rank_def: 708 + score_def: 322545 + rank_sup: 242 + score_sup: 939183 + rank_total: 254 + score_total: 6590874 + id: 7865511 + server_key: pl169 + name: Mr Dymer + num_villages: 247 + points: 2328267 + rank: 60 + tribe_id: 27 + created_at: 2021-09-03T18:00:59Z + profile_url: https://www.nationalsexy.info/cross-media/infrastructures/rich + - rank_att: 153 + score_att: 4485180 + rank_def: 134 + score_def: 4424857 + rank_sup: 165 + score_sup: 1512333 + rank_total: 169 + score_total: 10422370 + id: 698308405 + server_key: pl169 + name: dAT.. + num_villages: 149 + points: 1415990 + rank: 119 + created_at: 2021-09-08T02:00:58Z + deleted_at: 2022-08-08T02:00:58Z + profile_url: http://www.internale-business.info/mission-critical/transform diff --git a/internal/tw/client_test.go b/internal/tw/client_test.go index 9f9148d..872d105 100644 --- a/internal/tw/client_test.go +++ b/internal/tw/client_test.go @@ -82,8 +82,8 @@ func TestClient_GetServerConfig(t *testing.T) { cfg, err := newClient(srv.Client()).GetServerConfig(context.Background(), parseURL(t, srv.URL)) require.NoError(t, err) - assert.InEpsilon(t, 4.5, cfg.Speed, 0.01) - assert.InEpsilon(t, 0.5, cfg.UnitSpeed, 0.01) + assert.InDelta(t, 4.5, cfg.Speed, 0.01) + assert.InDelta(t, 0.5, cfg.UnitSpeed, 0.01) assert.Equal(t, 1, cfg.Moral) assert.Equal(t, 1, cfg.Build.Destroy) @@ -109,8 +109,8 @@ func TestClient_GetServerConfig(t *testing.T) { assert.Equal(t, 0, cfg.Game.Church) assert.Equal(t, 0, cfg.Game.Watchtower) assert.Equal(t, 0, cfg.Game.Stronghold) - assert.InEpsilon(t, 0.5, cfg.Game.FakeLimit, 0.01) - assert.InEpsilon(t, 0.001, cfg.Game.BarbarianRise, 0) + assert.InDelta(t, 0.5, cfg.Game.FakeLimit, 0.01) + assert.InDelta(t, 0.001, cfg.Game.BarbarianRise, 0) assert.Equal(t, 1, cfg.Game.BarbarianShrink) assert.Equal(t, 800, cfg.Game.BarbarianMaxPoints) assert.Equal(t, 1, cfg.Game.Scavenging) @@ -143,7 +143,7 @@ func TestClient_GetServerConfig(t *testing.T) { assert.Equal(t, 0, cfg.Snob.CheapRebuild) assert.Equal(t, 2, cfg.Snob.Rise) assert.Equal(t, 50, cfg.Snob.MaxDist) - assert.InEpsilon(t, 1.0, cfg.Snob.Factor, 0.01) + assert.InDelta(t, 1.0, cfg.Snob.Factor, 0.01) assert.Equal(t, 28000, cfg.Snob.CoinWood) assert.Equal(t, 30000, cfg.Snob.CoinStone) assert.Equal(t, 25000, cfg.Snob.CoinIron) @@ -186,7 +186,7 @@ func TestClient_GetServerConfig(t *testing.T) { assert.Equal(t, 2, cfg.Night.Active) assert.Equal(t, 23, cfg.Night.StartHour) assert.Equal(t, 7, cfg.Night.EndHour) - assert.InEpsilon(t, 3.5, cfg.Night.DefFactor, 0.01) + assert.InDelta(t, 3.5, cfg.Night.DefFactor, 0.01) assert.Equal(t, 14, cfg.Night.Duration) assert.Equal(t, 3, cfg.Win.Check) @@ -207,99 +207,99 @@ func TestClient_GetUnitInfo(t *testing.T) { unitInfo, err := newClient(srv.Client()).GetUnitInfo(context.Background(), parseURL(t, srv.URL)) require.NoError(t, err) - assert.InEpsilon(t, 226.66666666667, unitInfo.Spear.BuildTime, 0.01) + assert.InDelta(t, 226.66666666667, unitInfo.Spear.BuildTime, 0.01) assert.Equal(t, 1, unitInfo.Spear.Pop) - assert.InEpsilon(t, 8.0, unitInfo.Spear.Speed, 0.01) + assert.InDelta(t, 8.0, unitInfo.Spear.Speed, 0.01) assert.Equal(t, 10, unitInfo.Spear.Attack) assert.Equal(t, 15, unitInfo.Spear.Defense) assert.Equal(t, 45, unitInfo.Spear.DefenseCavalry) assert.Equal(t, 20, unitInfo.Spear.DefenseArcher) assert.Equal(t, 25, unitInfo.Spear.Carry) - assert.InEpsilon(t, 333.33333333333, unitInfo.Sword.BuildTime, 0.01) + assert.InDelta(t, 333.33333333333, unitInfo.Sword.BuildTime, 0.01) assert.Equal(t, 1, unitInfo.Sword.Pop) - assert.InEpsilon(t, 9.7777777777778, unitInfo.Sword.Speed, 0.01) + assert.InDelta(t, 9.7777777777778, unitInfo.Sword.Speed, 0.01) assert.Equal(t, 25, unitInfo.Sword.Attack) assert.Equal(t, 50, unitInfo.Sword.Defense) assert.Equal(t, 15, unitInfo.Sword.DefenseCavalry) assert.Equal(t, 40, unitInfo.Sword.DefenseArcher) assert.Equal(t, 15, unitInfo.Sword.Carry) - assert.InEpsilon(t, 293.33333333333, unitInfo.Axe.BuildTime, 0.01) + assert.InDelta(t, 293.33333333333, unitInfo.Axe.BuildTime, 0.01) assert.Equal(t, 1, unitInfo.Axe.Pop) - assert.InEpsilon(t, 8.0, unitInfo.Axe.Speed, 0.01) + assert.InDelta(t, 8.0, unitInfo.Axe.Speed, 0.01) assert.Equal(t, 40, unitInfo.Axe.Attack) assert.Equal(t, 10, unitInfo.Axe.Defense) assert.Equal(t, 5, unitInfo.Axe.DefenseCavalry) assert.Equal(t, 10, unitInfo.Axe.DefenseArcher) assert.Equal(t, 10, unitInfo.Axe.Carry) - assert.InEpsilon(t, 200.0, unitInfo.Spy.BuildTime, 0.01) + assert.InDelta(t, 200.0, unitInfo.Spy.BuildTime, 0.01) assert.Equal(t, 2, unitInfo.Spy.Pop) - assert.InEpsilon(t, 4.0, unitInfo.Spy.Speed, 0.01) + assert.InDelta(t, 4.0, unitInfo.Spy.Speed, 0.01) assert.Equal(t, 0, unitInfo.Spy.Attack) assert.Equal(t, 2, unitInfo.Spy.Defense) assert.Equal(t, 1, unitInfo.Spy.DefenseCavalry) assert.Equal(t, 2, unitInfo.Spy.DefenseArcher) assert.Equal(t, 0, unitInfo.Spy.Carry) - assert.InEpsilon(t, 400.0, unitInfo.Light.BuildTime, 0.01) + assert.InDelta(t, 400.0, unitInfo.Light.BuildTime, 0.01) assert.Equal(t, 4, unitInfo.Light.Pop) - assert.InEpsilon(t, 4.4444444444444, unitInfo.Light.Speed, 0.01) + assert.InDelta(t, 4.4444444444444, unitInfo.Light.Speed, 0.01) assert.Equal(t, 130, unitInfo.Light.Attack) assert.Equal(t, 30, unitInfo.Light.Defense) assert.Equal(t, 40, unitInfo.Light.DefenseCavalry) assert.Equal(t, 30, unitInfo.Light.DefenseArcher) assert.Equal(t, 80, unitInfo.Light.Carry) - assert.InEpsilon(t, 600.0, unitInfo.Marcher.BuildTime, 0.01) + assert.InDelta(t, 600.0, unitInfo.Marcher.BuildTime, 0.01) assert.Equal(t, 5, unitInfo.Marcher.Pop) - assert.InEpsilon(t, 4.4444444444444, unitInfo.Marcher.Speed, 0.01) + assert.InDelta(t, 4.4444444444444, unitInfo.Marcher.Speed, 0.01) assert.Equal(t, 120, unitInfo.Marcher.Attack) assert.Equal(t, 40, unitInfo.Marcher.Defense) assert.Equal(t, 30, unitInfo.Marcher.DefenseCavalry) assert.Equal(t, 50, unitInfo.Marcher.DefenseArcher) assert.Equal(t, 50, unitInfo.Marcher.Carry) - assert.InEpsilon(t, 800.0, unitInfo.Heavy.BuildTime, 0.01) + assert.InDelta(t, 800.0, unitInfo.Heavy.BuildTime, 0.01) assert.Equal(t, 6, unitInfo.Heavy.Pop) - assert.InEpsilon(t, 4.8888888888889, unitInfo.Heavy.Speed, 0.01) + assert.InDelta(t, 4.8888888888889, unitInfo.Heavy.Speed, 0.01) assert.Equal(t, 150, unitInfo.Heavy.Attack) assert.Equal(t, 200, unitInfo.Heavy.Defense) assert.Equal(t, 80, unitInfo.Heavy.DefenseCavalry) assert.Equal(t, 180, unitInfo.Heavy.DefenseArcher) assert.Equal(t, 50, unitInfo.Heavy.Carry) - assert.InEpsilon(t, 1066.6666666667, unitInfo.Ram.BuildTime, 0.01) + assert.InDelta(t, 1066.6666666667, unitInfo.Ram.BuildTime, 0.01) assert.Equal(t, 5, unitInfo.Ram.Pop) - assert.InEpsilon(t, 13.333333333333, unitInfo.Ram.Speed, 0.01) + assert.InDelta(t, 13.333333333333, unitInfo.Ram.Speed, 0.01) assert.Equal(t, 2, unitInfo.Ram.Attack) assert.Equal(t, 20, unitInfo.Ram.Defense) assert.Equal(t, 50, unitInfo.Ram.DefenseCavalry) assert.Equal(t, 20, unitInfo.Ram.DefenseArcher) assert.Equal(t, 0, unitInfo.Ram.Carry) - assert.InEpsilon(t, 1600.0, unitInfo.Catapult.BuildTime, 0.01) + assert.InDelta(t, 1600.0, unitInfo.Catapult.BuildTime, 0.01) assert.Equal(t, 8, unitInfo.Catapult.Pop) - assert.InEpsilon(t, 13.333333333333, unitInfo.Catapult.Speed, 0.01) + assert.InDelta(t, 13.333333333333, unitInfo.Catapult.Speed, 0.01) assert.Equal(t, 100, unitInfo.Catapult.Attack) assert.Equal(t, 100, unitInfo.Catapult.Defense) assert.Equal(t, 50, unitInfo.Catapult.DefenseCavalry) assert.Equal(t, 100, unitInfo.Catapult.DefenseArcher) assert.Equal(t, 0, unitInfo.Catapult.Carry) - assert.InEpsilon(t, 4000.0, unitInfo.Snob.BuildTime, 0.01) + assert.InDelta(t, 4000.0, unitInfo.Snob.BuildTime, 0.01) assert.Equal(t, 100, unitInfo.Snob.Pop) - assert.InEpsilon(t, 15.555555555556, unitInfo.Snob.Speed, 0.01) + assert.InDelta(t, 15.555555555556, unitInfo.Snob.Speed, 0.01) assert.Equal(t, 30, unitInfo.Snob.Attack) assert.Equal(t, 100, unitInfo.Snob.Defense) assert.Equal(t, 50, unitInfo.Snob.DefenseCavalry) assert.Equal(t, 100, unitInfo.Snob.DefenseArcher) assert.Equal(t, 0, unitInfo.Snob.Carry) - assert.InEpsilon(t, 1.0, unitInfo.Militia.BuildTime, 0.01) + assert.InDelta(t, 1.0, unitInfo.Militia.BuildTime, 0.01) assert.Equal(t, 0, unitInfo.Militia.Pop) - assert.InEpsilon(t, 0.016666666666667, unitInfo.Militia.Speed, 0.01) + assert.InDelta(t, 0.016666666666667, unitInfo.Militia.Speed, 0.01) assert.Equal(t, 0, unitInfo.Militia.Attack) assert.Equal(t, 15, unitInfo.Militia.Defense) assert.Equal(t, 45, unitInfo.Militia.DefenseCavalry) @@ -328,12 +328,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 80, buildingInfo.Main.Stone) assert.Equal(t, 70, buildingInfo.Main.Iron) assert.Equal(t, 5, buildingInfo.Main.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Main.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Main.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Main.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Main.PopFactor, 0.01) - assert.InEpsilon(t, 900.0, buildingInfo.Main.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Main.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Main.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Main.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Main.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Main.PopFactor, 0.01) + assert.InDelta(t, 900.0, buildingInfo.Main.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Main.BuildTimeFactor, 0.01) assert.Equal(t, 25, buildingInfo.Barracks.MaxLevel) assert.Equal(t, 0, buildingInfo.Barracks.MinLevel) @@ -341,12 +341,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 170, buildingInfo.Barracks.Stone) assert.Equal(t, 90, buildingInfo.Barracks.Iron) assert.Equal(t, 7, buildingInfo.Barracks.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Barracks.WoodFactor, 0.01) - assert.InEpsilon(t, 1.28, buildingInfo.Barracks.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Barracks.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Barracks.PopFactor, 0.01) - assert.InEpsilon(t, 1800.0, buildingInfo.Barracks.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Barracks.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Barracks.WoodFactor, 0.01) + assert.InDelta(t, 1.28, buildingInfo.Barracks.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Barracks.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Barracks.PopFactor, 0.01) + assert.InDelta(t, 1800.0, buildingInfo.Barracks.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Barracks.BuildTimeFactor, 0.01) assert.Equal(t, 20, buildingInfo.Stable.MaxLevel) assert.Equal(t, 0, buildingInfo.Stable.MinLevel) @@ -354,12 +354,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 240, buildingInfo.Stable.Stone) assert.Equal(t, 260, buildingInfo.Stable.Iron) assert.Equal(t, 8, buildingInfo.Stable.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Stable.WoodFactor, 0.01) - assert.InEpsilon(t, 1.28, buildingInfo.Stable.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Stable.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Stable.PopFactor, 0.01) - assert.InEpsilon(t, 6000.0, buildingInfo.Stable.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Stable.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Stable.WoodFactor, 0.01) + assert.InDelta(t, 1.28, buildingInfo.Stable.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Stable.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Stable.PopFactor, 0.01) + assert.InDelta(t, 6000.0, buildingInfo.Stable.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Stable.BuildTimeFactor, 0.01) assert.Equal(t, 15, buildingInfo.Garage.MaxLevel) assert.Equal(t, 0, buildingInfo.Garage.MinLevel) @@ -367,12 +367,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 240, buildingInfo.Garage.Stone) assert.Equal(t, 260, buildingInfo.Garage.Iron) assert.Equal(t, 8, buildingInfo.Garage.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Garage.WoodFactor, 0.01) - assert.InEpsilon(t, 1.28, buildingInfo.Garage.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Garage.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Garage.PopFactor, 0.01) - assert.InEpsilon(t, 6000.0, buildingInfo.Garage.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Garage.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Garage.WoodFactor, 0.01) + assert.InDelta(t, 1.28, buildingInfo.Garage.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Garage.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Garage.PopFactor, 0.01) + assert.InDelta(t, 6000.0, buildingInfo.Garage.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Garage.BuildTimeFactor, 0.01) assert.Equal(t, 20, buildingInfo.Watchtower.MaxLevel) assert.Equal(t, 0, buildingInfo.Watchtower.MinLevel) @@ -380,12 +380,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 14000, buildingInfo.Watchtower.Stone) assert.Equal(t, 10000, buildingInfo.Watchtower.Iron) assert.Equal(t, 500, buildingInfo.Watchtower.Pop) - assert.InEpsilon(t, 1.17, buildingInfo.Watchtower.WoodFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Watchtower.StoneFactor, 0.01) - assert.InEpsilon(t, 1.18, buildingInfo.Watchtower.IronFactor, 0.01) - assert.InEpsilon(t, 1.18, buildingInfo.Watchtower.PopFactor, 0.01) - assert.InEpsilon(t, 13200.0, buildingInfo.Watchtower.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Watchtower.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Watchtower.WoodFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Watchtower.StoneFactor, 0.01) + assert.InDelta(t, 1.18, buildingInfo.Watchtower.IronFactor, 0.01) + assert.InDelta(t, 1.18, buildingInfo.Watchtower.PopFactor, 0.01) + assert.InDelta(t, 13200.0, buildingInfo.Watchtower.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Watchtower.BuildTimeFactor, 0.01) assert.Equal(t, 1, buildingInfo.Snob.MaxLevel) assert.Equal(t, 0, buildingInfo.Snob.MinLevel) @@ -393,12 +393,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 25000, buildingInfo.Snob.Stone) assert.Equal(t, 10000, buildingInfo.Snob.Iron) assert.Equal(t, 80, buildingInfo.Snob.Pop) - assert.InEpsilon(t, 2.0, buildingInfo.Snob.WoodFactor, 0.01) - assert.InEpsilon(t, 2.0, buildingInfo.Snob.StoneFactor, 0.01) - assert.InEpsilon(t, 2.0, buildingInfo.Snob.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Snob.PopFactor, 0.01) - assert.InEpsilon(t, 586800.0, buildingInfo.Snob.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Snob.BuildTimeFactor, 0.01) + assert.InDelta(t, 2.0, buildingInfo.Snob.WoodFactor, 0.01) + assert.InDelta(t, 2.0, buildingInfo.Snob.StoneFactor, 0.01) + assert.InDelta(t, 2.0, buildingInfo.Snob.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Snob.PopFactor, 0.01) + assert.InDelta(t, 586800.0, buildingInfo.Snob.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Snob.BuildTimeFactor, 0.01) assert.Equal(t, 20, buildingInfo.Smith.MaxLevel) assert.Equal(t, 0, buildingInfo.Smith.MinLevel) @@ -406,12 +406,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 180, buildingInfo.Smith.Stone) assert.Equal(t, 240, buildingInfo.Smith.Iron) assert.Equal(t, 20, buildingInfo.Smith.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Smith.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Smith.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Smith.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Smith.PopFactor, 0.01) - assert.InEpsilon(t, 6000.0, buildingInfo.Smith.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Smith.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Smith.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Smith.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Smith.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Smith.PopFactor, 0.01) + assert.InDelta(t, 6000.0, buildingInfo.Smith.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Smith.BuildTimeFactor, 0.01) assert.Equal(t, 1, buildingInfo.Place.MaxLevel) assert.Equal(t, 0, buildingInfo.Place.MinLevel) @@ -419,12 +419,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 40, buildingInfo.Place.Stone) assert.Equal(t, 30, buildingInfo.Place.Iron) assert.Equal(t, 0, buildingInfo.Place.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Place.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Place.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Place.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Place.PopFactor, 0.01) - assert.InEpsilon(t, 10860.0, buildingInfo.Place.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Place.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Place.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Place.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Place.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Place.PopFactor, 0.01) + assert.InDelta(t, 10860.0, buildingInfo.Place.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Place.BuildTimeFactor, 0.01) assert.Equal(t, 1, buildingInfo.Statue.MaxLevel) assert.Equal(t, 0, buildingInfo.Statue.MinLevel) @@ -432,12 +432,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 220, buildingInfo.Statue.Stone) assert.Equal(t, 220, buildingInfo.Statue.Iron) assert.Equal(t, 10, buildingInfo.Statue.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Statue.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Statue.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Statue.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Statue.PopFactor, 0.01) - assert.InEpsilon(t, 1500.0, buildingInfo.Statue.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Statue.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Statue.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Statue.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Statue.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Statue.PopFactor, 0.01) + assert.InDelta(t, 1500.0, buildingInfo.Statue.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Statue.BuildTimeFactor, 0.01) assert.Equal(t, 25, buildingInfo.Market.MaxLevel) assert.Equal(t, 0, buildingInfo.Market.MinLevel) @@ -445,12 +445,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 100, buildingInfo.Market.Stone) assert.Equal(t, 100, buildingInfo.Market.Iron) assert.Equal(t, 20, buildingInfo.Market.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Market.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Market.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Market.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Market.PopFactor, 0.01) - assert.InEpsilon(t, 2700.0, buildingInfo.Market.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Market.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Market.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Market.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Market.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Market.PopFactor, 0.01) + assert.InDelta(t, 2700.0, buildingInfo.Market.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Market.BuildTimeFactor, 0.01) assert.Equal(t, 30, buildingInfo.Wood.MaxLevel) assert.Equal(t, 0, buildingInfo.Wood.MinLevel) @@ -458,12 +458,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 60, buildingInfo.Wood.Stone) assert.Equal(t, 40, buildingInfo.Wood.Iron) assert.Equal(t, 5, buildingInfo.Wood.Pop) - assert.InEpsilon(t, 1.25, buildingInfo.Wood.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Wood.StoneFactor, 0.01) - assert.InEpsilon(t, 1.245, buildingInfo.Wood.IronFactor, 0.01) - assert.InEpsilon(t, 1.155, buildingInfo.Wood.PopFactor, 0.01) - assert.InEpsilon(t, 900.0, buildingInfo.Wood.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Wood.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.25, buildingInfo.Wood.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Wood.StoneFactor, 0.01) + assert.InDelta(t, 1.245, buildingInfo.Wood.IronFactor, 0.01) + assert.InDelta(t, 1.155, buildingInfo.Wood.PopFactor, 0.01) + assert.InDelta(t, 900.0, buildingInfo.Wood.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Wood.BuildTimeFactor, 0.01) assert.Equal(t, 30, buildingInfo.Stone.MaxLevel) assert.Equal(t, 0, buildingInfo.Stone.MinLevel) @@ -471,12 +471,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 50, buildingInfo.Stone.Stone) assert.Equal(t, 40, buildingInfo.Stone.Iron) assert.Equal(t, 10, buildingInfo.Stone.Pop) - assert.InEpsilon(t, 1.27, buildingInfo.Stone.WoodFactor, 0.01) - assert.InEpsilon(t, 1.265, buildingInfo.Stone.StoneFactor, 0.01) - assert.InEpsilon(t, 1.24, buildingInfo.Stone.IronFactor, 0.01) - assert.InEpsilon(t, 1.14, buildingInfo.Stone.PopFactor, 0.01) - assert.InEpsilon(t, 900.0, buildingInfo.Stone.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Stone.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.27, buildingInfo.Stone.WoodFactor, 0.01) + assert.InDelta(t, 1.265, buildingInfo.Stone.StoneFactor, 0.01) + assert.InDelta(t, 1.24, buildingInfo.Stone.IronFactor, 0.01) + assert.InDelta(t, 1.14, buildingInfo.Stone.PopFactor, 0.01) + assert.InDelta(t, 900.0, buildingInfo.Stone.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Stone.BuildTimeFactor, 0.01) assert.Equal(t, 30, buildingInfo.Iron.MaxLevel) assert.Equal(t, 0, buildingInfo.Iron.MinLevel) @@ -484,12 +484,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 65, buildingInfo.Iron.Stone) assert.Equal(t, 70, buildingInfo.Iron.Iron) assert.Equal(t, 10, buildingInfo.Iron.Pop) - assert.InEpsilon(t, 1.252, buildingInfo.Iron.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Iron.StoneFactor, 0.01) - assert.InEpsilon(t, 1.24, buildingInfo.Iron.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Iron.PopFactor, 0.01) - assert.InEpsilon(t, 1080.0, buildingInfo.Iron.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Iron.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.252, buildingInfo.Iron.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Iron.StoneFactor, 0.01) + assert.InDelta(t, 1.24, buildingInfo.Iron.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Iron.PopFactor, 0.01) + assert.InDelta(t, 1080.0, buildingInfo.Iron.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Iron.BuildTimeFactor, 0.01) assert.Equal(t, 30, buildingInfo.Farm.MaxLevel) assert.Equal(t, 1, buildingInfo.Farm.MinLevel) @@ -497,12 +497,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 40, buildingInfo.Farm.Stone) assert.Equal(t, 30, buildingInfo.Farm.Iron) assert.Equal(t, 0, buildingInfo.Farm.Pop) - assert.InEpsilon(t, 1.3, buildingInfo.Farm.WoodFactor, 0.01) - assert.InEpsilon(t, 1.32, buildingInfo.Farm.StoneFactor, 0.01) - assert.InEpsilon(t, 1.29, buildingInfo.Farm.IronFactor, 0.01) - assert.InEpsilon(t, 1.0, buildingInfo.Farm.PopFactor, 0.01) - assert.InEpsilon(t, 1200.0, buildingInfo.Farm.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Farm.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.3, buildingInfo.Farm.WoodFactor, 0.01) + assert.InDelta(t, 1.32, buildingInfo.Farm.StoneFactor, 0.01) + assert.InDelta(t, 1.29, buildingInfo.Farm.IronFactor, 0.01) + assert.InDelta(t, 1.0, buildingInfo.Farm.PopFactor, 0.01) + assert.InDelta(t, 1200.0, buildingInfo.Farm.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Farm.BuildTimeFactor, 0.01) assert.Equal(t, 30, buildingInfo.Storage.MaxLevel) assert.Equal(t, 1, buildingInfo.Storage.MinLevel) @@ -510,12 +510,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 50, buildingInfo.Storage.Stone) assert.Equal(t, 40, buildingInfo.Storage.Iron) assert.Equal(t, 0, buildingInfo.Storage.Pop) - assert.InEpsilon(t, 1.265, buildingInfo.Storage.WoodFactor, 0.01) - assert.InEpsilon(t, 1.27, buildingInfo.Storage.StoneFactor, 0.01) - assert.InEpsilon(t, 1.245, buildingInfo.Storage.IronFactor, 0.01) - assert.InEpsilon(t, 1.15, buildingInfo.Storage.PopFactor, 0.01) - assert.InEpsilon(t, 1020.0, buildingInfo.Storage.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Storage.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.265, buildingInfo.Storage.WoodFactor, 0.01) + assert.InDelta(t, 1.27, buildingInfo.Storage.StoneFactor, 0.01) + assert.InDelta(t, 1.245, buildingInfo.Storage.IronFactor, 0.01) + assert.InDelta(t, 1.15, buildingInfo.Storage.PopFactor, 0.01) + assert.InDelta(t, 1020.0, buildingInfo.Storage.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Storage.BuildTimeFactor, 0.01) assert.Equal(t, 10, buildingInfo.Hide.MaxLevel) assert.Equal(t, 0, buildingInfo.Hide.MinLevel) @@ -523,12 +523,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 60, buildingInfo.Hide.Stone) assert.Equal(t, 50, buildingInfo.Hide.Iron) assert.Equal(t, 2, buildingInfo.Hide.Pop) - assert.InEpsilon(t, 1.25, buildingInfo.Hide.WoodFactor, 0.01) - assert.InEpsilon(t, 1.25, buildingInfo.Hide.StoneFactor, 0.01) - assert.InEpsilon(t, 1.25, buildingInfo.Hide.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Hide.PopFactor, 0.01) - assert.InEpsilon(t, 1800.0, buildingInfo.Hide.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Hide.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.25, buildingInfo.Hide.WoodFactor, 0.01) + assert.InDelta(t, 1.25, buildingInfo.Hide.StoneFactor, 0.01) + assert.InDelta(t, 1.25, buildingInfo.Hide.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Hide.PopFactor, 0.01) + assert.InDelta(t, 1800.0, buildingInfo.Hide.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Hide.BuildTimeFactor, 0.01) assert.Equal(t, 20, buildingInfo.Wall.MaxLevel) assert.Equal(t, 0, buildingInfo.Wall.MinLevel) @@ -536,12 +536,12 @@ func TestClient_GetBuildingInfo(t *testing.T) { assert.Equal(t, 100, buildingInfo.Wall.Stone) assert.Equal(t, 20, buildingInfo.Wall.Iron) assert.Equal(t, 5, buildingInfo.Wall.Pop) - assert.InEpsilon(t, 1.26, buildingInfo.Wall.WoodFactor, 0.01) - assert.InEpsilon(t, 1.275, buildingInfo.Wall.StoneFactor, 0.01) - assert.InEpsilon(t, 1.26, buildingInfo.Wall.IronFactor, 0.01) - assert.InEpsilon(t, 1.17, buildingInfo.Wall.PopFactor, 0.01) - assert.InEpsilon(t, 3600.0, buildingInfo.Wall.BuildTime, 0.01) - assert.InEpsilon(t, 1.2, buildingInfo.Wall.BuildTimeFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Wall.WoodFactor, 0.01) + assert.InDelta(t, 1.275, buildingInfo.Wall.StoneFactor, 0.01) + assert.InDelta(t, 1.26, buildingInfo.Wall.IronFactor, 0.01) + assert.InDelta(t, 1.17, buildingInfo.Wall.PopFactor, 0.01) + assert.InDelta(t, 3600.0, buildingInfo.Wall.BuildTime, 0.01) + assert.InDelta(t, 1.2, buildingInfo.Wall.BuildTimeFactor, 0.01) } func TestClient_GetTribes(t *testing.T) {