public async Task <ActionResult> GetAllBridgesPoints() { var presenter = new BridgesPointListPresenter(); await _getBridgesPointListUseCase.Handle(GetBridgesPointListUseCaseRequest.CreateAllBridgesPointsRequest(), presenter); return(presenter.ContentResult); }
public void TestGetAllBridgesPointsFromEmptyRepository() { var useCase = new GetBridgesPointListUseCase(new InMemoryBridgesPointRepository()); var outputPort = new OutputPort(); Assert.True(useCase.Handle(GetBridgesPointListUseCaseRequest.CreateAllBridgesPointsRequest(), outputPort).Result); Assert.Empty(outputPort.BridgesPoints); }
public void TestGetAllBridgesPoints() { var useCase = new GetBridgesPointListUseCase(CreateBridgesPointtRepository()); var outputPort = new OutputPort(); Assert.True(useCase.Handle(GetBridgesPointListUseCaseRequest.CreateAllBridgesPointsRequest(), outputPort).Result); Assert.Equal <int>(4, outputPort.BridgesPoints.Count()); Assert.Equal(new long[] { 1, 2, 3, 4 }, outputPort.BridgesPoints.Select(mp => mp.Id)); }