Ejemplo n.º 1
0
        public async Task ShouldNotCallMediatorToCreateButReturnEmptyListIfFeatureToggleIsOff()
        {
            //Arrange
            _mockFeatureToggle.Setup(x => x.FeatureEnabled).Returns(false);

            //Act
            var list = await EmployerCommitmentOrchestrator.GetTransferConnections(HashedAccountId, UserId);

            //Assert
            Assert.IsEmpty(list.Data.TransferConnections);
            MockMediator.Verify(x => x.SendAsync(It.IsAny <GetAccountTransferConnectionsRequest>()), Times.Never);
        }
Ejemplo n.º 2
0
        public async Task ShouldCallMediatorToCreateAndReturnListIfFeatureToggleIsOn()
        {
            //Arrange
            _mockFeatureToggle.Setup(x => x.FeatureEnabled).Returns(true);

            //Act
            var list = await EmployerCommitmentOrchestrator.GetTransferConnections(HashedAccountId, UserId);

            //Assert
            Assert.IsNotEmpty(list.Data.TransferConnections);
            Assert.AreEqual(1, list.Data.TransferConnections.Count());
            MockMediator.Verify(x => x.SendAsync(It.Is <GetAccountTransferConnectionsRequest>(c =>
                                                                                              c.HashedAccountId == HashedAccountId && c.UserId == UserId)), Times.Once);
        }