Пример #1
0
 public void SetUp()
 {
     _mockGateway    = new Mock <IResidentGateway>();
     _classUnderTest = new GetAllUseCase(_mockGateway.Object);
     _fixture        = new Fixture();
     _fixture.Behaviors.OfType <ThrowingRecursionBehavior>().ToList()
     .ForEach(b => _fixture.Behaviors.Remove(b));
     _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
 }
Пример #2
0
        public void NoProductsAvailable_ShouldReturnEmptyList()
        {
            // Arrange
            var repository = GetEmptyProductRepository();
            var sut        = new GetAllUseCase(repository);

            // Act
            var actual = sut.Execute();

            // Assert
            actual
            .Should()
            .BeEmpty();
        }
Пример #3
0
        public async Task GetAllUseCase_NoItemsExist_ShouldReturnEmptyList()
        {
            // Arrange
            var repository = new FakeSimpleEntityEmptyListRepository();
            var presenter  = new FakeGetAllOutputHandler();

            var sut = new GetAllUseCase(presenter, repository);

            // Act
            await sut.Execute();

            // Assert
            presenter.ViewModel
            .Should()
            .BeEquivalentTo(repository.Data);
        }
Пример #4
0
        public void ProductsAvailable_ShouldReturnAListOfProducts()
        {
            // Arrange
            var repository = GetProductRepository();
            var sut        = new GetAllUseCase(repository);

            // Act
            var actual = sut.Execute();

            // Assert
            actual
            .Should()
            .NotBeEmpty();

            actual.Count
            .Should()
            .Be(1);
        }
 public void SetUp()
 {
     _mockGateway    = new Mock <IExampleGateway>();
     _classUnderTest = new GetAllUseCase(_mockGateway.Object);
     _fixture        = new Fixture();
 }
        public async Task <ActionResult <ListResultDto <ProductGetAllOutputDto> > > GetAll([FromBody] ProductGetAllInputDto request)
        {
            await GetAllUseCase.HandleUseCase(request, GetAllPresenter);

            return(GetAllPresenter.Result);
        }
 public void SetUp(GetAllUseCase getAllUseCase)
 {
     _getAllUseCase  = new Mock <IGetAllUseCase>();
     _classUnderTest = new BaseApiController(_getAllUseCase.Object);
 }