Wicket / MVC Architectural / Test Question

I had to code something in Wicket (or take any MVC framework), which provided that 2 variables A and B provide a logical result C, which indicates whether something is visible (checkbox) or not.

Now this is presentation logic, but let it not be as trivial as: C = A && B; Maybe some kind of automatic testing is good.

Where would you put this logic? Is it possible to host it at the Model / Service level and test it with JUnit? In my understanding, the model and services are reserved for business logic.

Or do you keep it in view, in which case you test it with something like Selenium?

Or create some static method in some Utility packages?

I would build it to do this, and build a test for it as simple as possible, but do not mix it with services. Therefore, I would choose the static utility method.

+3
source share
3 answers

I also use complex visibility logic in one of my MVK gate projects, and I put this logic in the service level and I am testing this code with JUnit . I also have a wickletter test that also checks the visibility of a checkbox. I do not know that this is the best way, but to think that it is not bad. Hope it helps.

+1
source

p.o.v. , - , . , /.

/ - , , . MVP MVVM.

0

This is presentation logic and, as such, it should be at the presentation level.

Personally, I would test this using Selenium. It depends on how you make the appearance, using a wicket may be enough, but all the browsing logic should be tested on real browsers using a tool like Selenium.

You should definitely not use the static utility method, for which see here

0
source

All Articles