Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName GamesTest:SharedUI_ButtonHint extends GamesTest:Framework:Lilac
- import Games:Papyrus:Log
- import Games:Shared
- import Games:Shared:UI:ButtonHint
- ; Events
- ;---------------------------------------------
- Event Games:Shared:UI:Display.OnLoaded(UI:Display akSender, var[] arguments)
- Button HelloButton = new Button
- HelloButton.Text = "Hello World"
- HelloButton.KeyCode = 69
- ButtonHint.SetButton(HelloButton)
- ButtonHint.Show() ; waits for thread
- EndEvent
- Event Games:Shared:UI:ButtonHint.OnSelected(UI:ButtonHint akSender, var[] arguments)
- ; I need button arguments!
- EndEvent
- ; Lilac
- ;---------------------------------------------
- Function TestSuites()
- describe("Shared UI ButtonHint", ButtonHintSuite())
- EndFunction
- Function beforeEach()
- RegisterForCustomEvent(ButtonHint, "OnLoaded")
- RegisterForCustomEvent(ButtonHint, "OnSelected")
- EndFunction
- Function afterEach()
- UnregisterForCustomEvent(ButtonHint, "OnLoaded")
- UnregisterForCustomEvent(ButtonHint, "OnSelected")
- EndFunction
- ; Test Suites
- ;---------------------------------------------
- bool Function ButtonHintSuite()
- it("should be able to load", loadTest())
- it("should be able to be shown", shownTest())
- it("should be able to be hidden", hiddenTest())
- return true
- EndFunction
- bool Function loadTest()
- expect(ButtonHint.IsLoaded, to, beFalsy)
- ButtonHint.Load()
- expect(ButtonHint.IsLoaded, to, beTruthy)
- return true
- EndFunction
- bool Function shownTest()
- ButtonHint.Show()
- expect(ButtonHint.Visible, to, beTruthy)
- return true
- EndFunction
- bool Function hiddenTest()
- ButtonHint.Hide()
- expect(ButtonHint.Visible, to, beFalsy)
- return true
- EndFunction
- ; Properties
- ;---------------------------------------------
- Group ButtonHint
- UI:ButtonHint Property ButtonHint Auto Const Mandatory
- EndGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement