コード例 #1
0
        public void PostAnyParameters(string numeroCartao, double valorTransacao)
        {
            // Arrange
            var mock = new Mock <IAntifraude>();

            mock.Setup(x => x.ValidarTransacao(It.IsAny <string>(), It.IsAny <double>()));
            var controller = new AntifraudeController(mock.Object);

            // Act
            var result = controller.Post(numeroCartao, valorTransacao);

            // Assert
            Assert.IsNotNull(result);
        }
コード例 #2
0
        public void PostArgumentException()
        {
            // Arrange
            var mock = new Mock <IAntifraude>();

            mock.Setup(x => x.ValidarTransacao(It.IsAny <string>(), It.IsAny <double>()));
            var controller     = new AntifraudeController(mock.Object);
            var numeroCartao   = "65165--165165";
            var valorTransacao = 10;

            // Act
            var result = controller.Post(numeroCartao, valorTransacao);

            // Assert
        }