예제 #1
0
        public void mustRenderRequestSubmittedWindow()
        {
            USSDApplication app     = getTestApp1();
            USSDRequest     request = app.newRequest("1234");

            fillRequest(request);

            USSDResponse response = BantU.executeRequest(getTestApp1(), request);

            Assert.AreEqual("operations", response.getWindow().getId());
            Assert.AreEqual(ResponseType.FORM, response.getResponseType());
            request = app.newRequest("1");
            fillRequest(request);

            response = BantU.executeRequest(getTestApp1(), request);
            Assert.AreEqual("transfers", response.getWindow().getId());
            Assert.AreEqual(ResponseType.FORM, response.getResponseType());
            request = app.newRequest("2");
            fillRequest(request);

            response = BantU.executeRequest(getTestApp1(), request);
            Assert.AreEqual("amountWindow", response.getWindow().getId());
            Assert.AreEqual(ResponseType.FORM, response.getResponseType());
            request = app.newRequest("1000");
            fillRequest(request);

            response = BantU.executeRequest(getTestApp1(), request);
            Assert.AreEqual("requestSubmitted", response.getWindow().getId());
            Assert.AreEqual(ResponseType.MESSAGE, response.getResponseType());
        }
예제 #2
0
        public void mustRenderOperationsWindow()
        {
            USSDRequest request = getTestApp1().newRequest("1234");

            fillRequest(request);
            USSDResponse response = BantU.executeRequest(getTestApp1(), request);

            Assert.AreEqual("operations", response.getWindow().getId());
            Assert.AreEqual(ResponseType.FORM, response.getResponseType());
        }
예제 #3
0
        public void mustRenderLoginWindow()
        {
            USSDRequest request = getTestApp1().newRequest(TEST_BASE_CODE);

            fillRequest(request);
            USSDResponse response = BantU.executeRequest(getTestApp1(), request);

            Assert.AreEqual("login", response.getWindow().getId());
            Assert.AreEqual(ResponseType.FORM, response.getResponseType());
        }
예제 #4
0
        public void mustRenderPasswordRecoverWindow()
        {
            USSDRequest request = getTestApp1().newRequest("1111");

            fillRequest(request);
            USSDApplication app      = getTestApp1();
            USSDResponse    response = BantU.executeRequest(getTestApp1(), request);

            Assert.AreEqual("recoverPassowrd", response.getWindow().getId());
            Assert.AreEqual(ResponseType.MESSAGE, response.getResponseType());
        }
예제 #5
0
        public void windowFilterMustBeInvoked()
        {
            USSDApplication app    = new BaseUSSDApplication();
            Window          window = new Window("startup");

            window.addMessage(new Message("Welcome, please type something"));
            window.setInput(new Input {
                Name = "something"
            });
            app.addWindowFilter(window.getId(), new StartupWindowFirstFilter());
            app.addWindowFilter(window.getId(), new StartupWindowSecondFilter());

            app.addWindow(window);
            app.setStartupWindowId(window.getId());

            USSDRequest request = app.newRequest(TEST_BASE_CODE);

            fillRequest(request);
            USSDResponse response = BantU.executeRequest(app, request);

            Assert.AreEqual("Altered by the second filter", response.getWindow().getMessages()[0]);
        }