This solution contains project that hosts SyncProfileRequest service and UserInfoProvider WCF service in one console application (Microsoft.OWIN library is used). Also it contains TestApi service that can also be invoked: it is being used for test data management in functional tests.
- Build
UserRepositoryService.slnin Visual Studio. - Run application
UserRepositoryServiceApp.exefrom"..UserRepositoryService\UserRepositoryServiceApp\bin\Debug"
- Address: derived from
App.configfile; By default: http://localhost:2828/import.json - Actions: support POST method. If
SyncProfileRequestcontains existingUserId, the corresponding data is being updated; ifUserIddoes not exist, new data is being created. Standard HTTP statuses are being returned; - Logging: Serilog .NET library. Sink:
FileLogger. Configuration:App.config; - Communicates with internal repositories through the special manager class.
- Address, binding and behaviours are in
App.configAddress by default: http://localhost:2828/UserInfoProviderService - Actions: retrieves information for specific user by
Id. Specific DTO is being used; - Logging: Serilog .NET library. Sink:
FileLogger. Configuration:App.config; - Communicates with internal repositories through the special manager class.
This is helper for managing test data (CRUD methods for user sync requests) http://localhost:2828/api/TestApi
- Data (converters, DTO, internal entities...);
- Managers to transfer and translate data between services and internals;
UserRepositoryFactory(Factory based on string repositoryType; interface; three possible implementations...)- Models and Controllers
- Services (WCF interface and implementation) and Faults
- Logging
- xUnit as base unit test framework. Also VS runner, xUnit additional libraries are being used;
- RestSharp for REST API service testing;
- .NET SVC util is being used for generating proxy for WCF service (Proxy -> CreateServiceProxy.cmd script).
UserRepositoryServiceProxycontain auto-generated class. - Utils:
UserRepositoryUtils- wrapper for TestApi REST callsTestUtils- common helpersTestRunConfiguration- contains configured entities to use in tests
- Cleanup logic for test data that have been generated across test run (Users in repository). Cleanup is being provided by xUnit fixtures that allow to implement dispose logic.
SyncProfileRequestServiceTests: negative and positive scenarios
- verification against repository
- verification against HTTP status codes
- verification against logger logic
UserInfoProviderServiceTests: negative and positive scenarios
- verification against repository
- verification against logger logic