Library for download list of stations and give interface for UI for select one based on typed letters
Full documentation is in refman.pdf and can be regenerated with doxygen
The main goal is return as fast as possible acceptable chars for complete search and possible stations based on input query.
Result can be used to get price of ticket by using station code and buy selected choice. Pricing should be implemented in another projects as is no information and requirements for that.
- Typing a search string will return:
- All stations that start with the search string.
- All valid next characters for each matched station.
- Space is a valid character when returning a list of next characters.
- The service response will be used for the machine UI and for the routing and pricing purposes.
-
Runtime speed is very important, loading time is not.
-
Make no assumptions about the data source in real life.
-
Expected Scenarios:
- Given a list of stations
DARTFORD
,DARTON
,TOWER HILL
,DERBY
- When input
DART
- Then should return:
- The characters of
F
O
- The stations
DARTFORD
,DARTON
- The characters of
- When input
- Given a list of stations
LIVERPOOL
,LIVERPOOL LIME STREET
,PADDINGTON
- When input
LIVERPOOL
- Then should return:
- The characters of
' '
(space) - The stations
LIVERPOOL
,LIVERPOOL LIME STREET
- The characters of
- When input
- Given a list of stations
EUSTON
,LONDON BRIDGE
,VICTORIA
- When input
KINGS CROSS
- Then should return:
- no next characters
- no stations
- When input
These scenarios are tested in project:
TicketMachine.DB.Tests
with tests in OperationalRequirementsTests/ScenariosTest.csTicketMachine.Controllers.Tests
with tests in OperationalRequirementsTests/ControllerScenariosTest.cs
- Given a list of stations
User can input only ASCII letters (A-Z) and space.
In the projects TicketMachine.md and TicketMachine.WebApi.md there is an example application that uses a library for searching stations.
Libraries what not come from Microsoft company:
- Palmer, licence MIT:
- simple library providing retry logic
- source:
- MockHttp, licence MIT
- Testing layer for Microsoft HttpClient providing mock
- source:
- Json.Net, licence MIT:
- Json parser
Others:
- NUnit (with NUnit3TestAdapter, NUnit.Analyzer)
- Moq (with Castle.Core)
- coverlet.collector
Documentation are generated by doxygen and plantuml:
For doxygen there is configuration file: doxygen.conf For simplify process there is script written in bash: make_doc.sh
Work is split into two stages:
- stage 1 - most important thinks to make in given time
- stage 2 - future improvements
Status | Task |
---|---|
[DONE] | Working code |
[DONE] | Documentation: * Function and code description * Graphs * Project description |
[DONE] | Tests |
Tasks:
- Add logger (NLog)
- Tests on big data
- Improve speed:
- Add letters indexing
- Check other search algorithm
- Check if mixed algorithms can improve speed
- Search params by genetic or linear algorithm
- Check if mixed algorithms can improve speed
- Retest
- Check different memory access and allocating
Licence MIT is in file LICENSE.md