public async Task <ActionResult> GetAllParkWifis() { var presenter = new ParkWifiListPresenter(); await _getParkWifiListUseCase.Handle(GetParkWifiListUseCaseRequest.CreateAllParkWifisRequest(), presenter); return(presenter.ContentResult); }
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)); }