mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Refactor displays to allow for centralized remote configuration.
This commit is contained in:
@@ -8,7 +8,6 @@ package model
|
||||
type EventSettings struct {
|
||||
Id int
|
||||
Name string
|
||||
DisplayBackgroundColor string
|
||||
NumElimAlliances int
|
||||
SelectionRound2Order string
|
||||
SelectionRound3Order string
|
||||
@@ -46,7 +45,6 @@ func (database *Database) GetEventSettings() (*EventSettings, error) {
|
||||
if err != nil {
|
||||
// Database record doesn't exist yet; create it now.
|
||||
eventSettings.Name = "Untitled Event"
|
||||
eventSettings.DisplayBackgroundColor = "#00ff00"
|
||||
eventSettings.NumElimAlliances = 8
|
||||
eventSettings.SelectionRound2Order = "L"
|
||||
eventSettings.SelectionRound3Order = ""
|
||||
|
||||
@@ -13,12 +13,11 @@ func TestEventSettingsReadWrite(t *testing.T) {
|
||||
|
||||
eventSettings, err := db.GetEventSettings()
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, EventSettings{Id: 0, Name: "Untitled Event", DisplayBackgroundColor: "#00ff00",
|
||||
NumElimAlliances: 8, SelectionRound2Order: "L", SelectionRound3Order: "", TBADownloadEnabled: true,
|
||||
ApTeamChannel: 157, ApAdminChannel: 11, ApAdminWpaKey: "1234Five"}, *eventSettings)
|
||||
assert.Equal(t, EventSettings{Id: 0, Name: "Untitled Event", NumElimAlliances: 8, SelectionRound2Order: "L",
|
||||
SelectionRound3Order: "", TBADownloadEnabled: true, ApTeamChannel: 157, ApAdminChannel: 11,
|
||||
ApAdminWpaKey: "1234Five"}, *eventSettings)
|
||||
|
||||
eventSettings.Name = "Chezy Champs"
|
||||
eventSettings.DisplayBackgroundColor = "#ff00ff"
|
||||
eventSettings.NumElimAlliances = 6
|
||||
eventSettings.SelectionRound2Order = "F"
|
||||
eventSettings.SelectionRound3Order = "L"
|
||||
|
||||
Reference in New Issue
Block a user