This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brightroll adapter - adding config support (prebid#1461)
- Loading branch information
1 parent
d517442
commit 66e0076
Showing
14 changed files
with
236 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
package brightroll | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
|
||
"github.com/prebid/prebid-server/adapters/adapterstest" | ||
) | ||
|
||
func TestEmptyConfig(t *testing.T) { | ||
output := NewBrightrollBidder("http://test-bid.ybp.yahoo.com/bid/appnexuspbs", "") | ||
ex := ExtraInfo{ | ||
Accounts: []Account{}, | ||
} | ||
expected := &BrightrollAdapter{ | ||
URI: "http://test-bid.ybp.yahoo.com/bid/appnexuspbs", | ||
extraInfo: ex, | ||
} | ||
assert.Equal(t, expected, output, "") | ||
} | ||
|
||
func TestNonEmptyConfig(t *testing.T) { | ||
output := NewBrightrollBidder("http://test-bid.ybp.yahoo.com/bid/appnexuspbs", "{\"accounts\": [{\"id\": \"test\",\"bidfloor\":0.1}]}") | ||
ex := ExtraInfo{ | ||
Accounts: []Account{{ID: "test", BidFloor: 0.1}}, | ||
} | ||
|
||
expected := &BrightrollAdapter{ | ||
URI: "http://test-bid.ybp.yahoo.com/bid/appnexuspbs", | ||
extraInfo: ex, | ||
} | ||
assert.Equal(t, expected, output, "") | ||
} | ||
|
||
func TestJsonSamples(t *testing.T) { | ||
adapterstest.RunJSONBidderTest(t, "brightrolltest", NewBrightrollBidder("http://test-bid.ybp.yahoo.com/bid/appnexuspbs")) | ||
adapterstest.RunJSONBidderTest(t, "brightrolltest", NewBrightrollBidder("http://test-bid.ybp.yahoo.com/bid/appnexuspbs", "{\"accounts\": [{\"id\": \"adthrive\",\"badv\": [], \"bcat\": [\"IAB8-5\",\"IAB8-18\"],\"battr\": [1,2,3], \"bidfloor\":0.0}]}")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.