diff --git a/projects/nat-archive-tool/src/test/DummyUI.hx b/projects/nat-archive-tool/src/test/DummyUI.hx new file mode 100644 index 00000000..ccfa4f27 --- /dev/null +++ b/projects/nat-archive-tool/src/test/DummyUI.hx @@ -0,0 +1,40 @@ +package test; + +import nat.*; +import nat.ArchiveController.ChangeSet; + +class DummyUI implements ArchiveUI { + var controller:ArchiveController = null; + + public function new() {} + + public function setController(controller:ArchiveController) { + this.controller = controller; + } + + public function enterText(prompt:String, resolve:(String) -> Void, maxLength:Float) { + // TODO for proper testing, this will need to resolve with specific pre-coded strings + resolve(""); + } + + public function enterNumber(prompt:String, resolve:(Float) -> Void, min:Float, max:Float, ?inStepsOf:Float) { + // TODO for proper testing, this will need to resolve with specific pre-coded numbers + resolve(min); + } + + public function chooseEntry(prompt:String, archive:Archive, resolve:(Entry) -> Void) { + // TODO for proper testing, this will need to resolve with specific pre-coded entries + resolve(null); + } + + public function chooseEntries(prompt:String, archive:Archive, resolve:(Array) -> Void, min:Int, max:Float) { + // TODO for proper testing, this will need to resolve with specific pre-coded entry lists + resolve([]); + } + + public function handleChanges(archive:Archive, changeSet:ChangeSet) {} + + public function displayMessage(message:String) {} + + public function reportError(error:String) {} +} diff --git a/projects/nat-archive-tool/src/test/TestMain.kiss b/projects/nat-archive-tool/src/test/TestMain.kiss index 9853f4ca..13e08b13 100644 --- a/projects/nat-archive-tool/src/test/TestMain.kiss +++ b/projects/nat-archive-tool/src/test/TestMain.kiss @@ -34,6 +34,6 @@ ~(wikipedia.queryImageUrls (wikipedia.queryImageTitles ["Phoenix Wright"]))) // TODO make a dummy UI for this, instead of passing null - (let [controller (new ArchiveController archive null)] + (let [controller (new ArchiveController archive (new DummyUI))] // TODO test controller 0))