public CreateContactUseCaseTests()
        {
            _mockGateway    = new Mock <IContactDetailsGateway>();
            _mockSnsGateway = new Mock <ISnsGateway>();
            _mockSnsFactory = new Mock <ISnsFactory>();

            _classUnderTest = new CreateContactUseCase(_mockGateway.Object, _mockSnsGateway.Object, _mockSnsFactory.Object);
        }
Ejemplo n.º 2
0
        public void Should_call_repository_insert_method_once()
        {
            var mockRepository = Mock.Of <IContactRepository>();

            var useCase = new CreateContactUseCase(mockRepository);

            useCase.Execute(ContactFactory.Create());

            Mock.Get(mockRepository).Verify(x =>
                                            x.InsertContact(It.IsAny <Contact>()), Times.Once);
        }
        public CreateContactUseCaseTests()
        {
            _mockGateway    = new Mock <IContactDetailsGateway>();
            _mockSnsGateway = new Mock <ISnsGateway>();
            _mockSnsFactory = new Mock <ISnsFactory>();

            _token          = _fixture.Create <Token>();
            _classUnderTest = new CreateContactUseCase(_mockGateway.Object, _mockSnsGateway.Object, _mockSnsFactory.Object);

            _mockGateway.Setup(x => x.GetContactDetailsByTargetId(It.IsAny <ContactQueryParameter>()))
            .ReturnsAsync(new List <ContactDetails>());
        }