Skip to content

Commit

Permalink
zentotem: add adapter
Browse files Browse the repository at this point in the history
add adapter for zentotem
  • Loading branch information
GermanBogatov committed Aug 20, 2024
1 parent f075a67 commit 6f3f47c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions adapters/zentotem/zentotem_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package zentotem

import (
"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/v2/adapters/adapterstest"
"github.com/prebid/prebid-server/v2/config"
"github.com/prebid/prebid-server/v2/openrtb_ext"
"github.com/stretchr/testify/assert"
"testing"
)

Expand All @@ -17,3 +19,54 @@ func TestJsonSamples(t *testing.T) {

adapterstest.RunJSONBidderTest(t, "zentotemtest", bidder)
}

func TestGetMediaTypeForBid(t *testing.T) {
tests := []struct {
name string
imp openrtb2.Imp
wantType openrtb_ext.BidType
wantErr bool
}{
{
name: "get bid native type",
imp: openrtb2.Imp{
Native: &openrtb2.Native{
Request: "test",
},
},
wantType: openrtb_ext.BidTypeNative,
wantErr: false,
},
{
name: "get bid banner type",
imp: openrtb2.Imp{
Banner: &openrtb2.Banner{
ID: "test",
},
},
wantType: openrtb_ext.BidTypeBanner,
wantErr: false,
},
{
name: "get bid video type",
imp: openrtb2.Imp{
Video: &openrtb2.Video{
PodID: "test",
},
},
wantType: openrtb_ext.BidTypeVideo,
wantErr: false,
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
bType, err := getMediaTypeForBid(tt.imp)
if (err != nil) != tt.wantErr {
t.Errorf("getMediaTypeForBid error = %v, wantErr %v", err, tt.wantErr)
}

assert.Equal(t, bType, tt.wantType)
})
}
}

0 comments on commit 6f3f47c

Please sign in to comment.