Пример #1
0
        public async Task <ActionResult> GetParkWifi(long parkwifiId)
        {
            var presenter = new ParkWifiListPresenter();
            await _getParkWifiListUseCase.Handle(GetParkWifiListUseCaseRequest.CreateParkWifiRequest(parkwifiId), presenter);

            return(presenter.ContentResult);
        }
Пример #2
0
        public async Task <ActionResult> GetParkNameParkWifis(string parkname)
        {
            var presenter = new ParkWifiListPresenter();
            await _getParkWifiListUseCase.Handle(GetParkWifiListUseCaseRequest.CreateParkWifisRequest(parkname), presenter);

            return(presenter.ContentResult);
        }
Пример #3
0
        public async Task <ActionResult> GetAllParkWifis()
        {
            var presenter = new ParkWifiListPresenter();
            await _getParkWifiListUseCase.Handle(GetParkWifiListUseCaseRequest.CreateAllParkWifisRequest(), presenter);

            return(presenter.ContentResult);
        }
        public void TestTryGetNotExistingParkWifi()
        {
            var useCase    = new GetParkWifiListUseCase(CreateParkWifiRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetParkWifiListUseCaseRequest.CreateParkWifiRequest(999), outputPort).Result);
            Assert.Empty(outputPort.ParkWifis);
        }
        public void TestGetParkWifi()
        {
            var useCase    = new GetParkWifiListUseCase(CreateParkWifiRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetParkWifiListUseCaseRequest.CreateParkWifiRequest(2), outputPort).Result);
            Assert.Single(outputPort.ParkWifis, pn => 2 == pn.Id);
        }
        public void TestGetAllParkWifisFromEmptyRepository()
        {
            var useCase    = new GetParkWifiListUseCase(new InMemoryParkWifiRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetParkWifiListUseCaseRequest.CreateAllParkWifisRequest(), outputPort).Result);
            Assert.Empty(outputPort.ParkWifis);
        }
        public void TestGetAllParkWifi()
        {
            var useCase    = new GetParkWifiListUseCase(CreateParkWifiRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetParkWifiListUseCaseRequest.CreateAllParkWifisRequest(), outputPort).Result);
            Assert.Equal <int>(4, outputPort.ParkWifis.Count());
            Assert.Equal(new long[] { 1, 2, 3, 4 }, outputPort.ParkWifis.Select(mp => mp.Id));
        }