public void TestTryGetNotExistingCommercialobj()
        {
            var useCase    = new GetCommercialobjListUseCase(CreateCommercialobjRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetCommercialobjListUseCaseRequest.CreateCommercialobjRequest(999), outputPort).Result);
            Assert.Empty(outputPort.Commercialobjs);
        }
        public void TestGetAllCommercialobjsFromEmptyRepository()
        {
            var useCase    = new GetCommercialobjListUseCase(new InMemoryCommercialobjRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetCommercialobjListUseCaseRequest.CreateAllCommercialobjsRequest(), outputPort).Result);
            Assert.Empty(outputPort.Commercialobjs);
        }
        public void TestGetCommercialobj()
        {
            var useCase    = new GetCommercialobjListUseCase(CreateCommercialobjRepository());
            var outputPort = new OutputPort();

            Assert.True(useCase.Handle(GetCommercialobjListUseCaseRequest.CreateCommercialobjRequest(2), outputPort).Result);
            Assert.Single(outputPort.Commercialobjs, pn => 2 == pn.Id);
        }
        public void TestGetAllCommercialobj()
        {
            var useCase    = new GetCommercialobjListUseCase(CreateCommercialobjRepository());
            var outputPort = new OutputPort();

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