Esempio n. 1
0
        public void GetAllPayments()
        {
            var result = _paymentController.GetAllPayments();

            // verify GET returns Ok Status
            Assert.IsType <OkObjectResult>(result.Result);
        }
Esempio n. 2
0
        public void GetAllPayments_Returns_PaymentModelArray()
        {
            // Arrange
            var paymentBLLMock = _mocks.Create <IPaymentBLL>();

            paymentBLLMock.Setup(m => m.GetAllPayments())
            .Returns(new PaymentDto[] { new PaymentDto(), new PaymentDto() });

            var controller = new PaymentController(paymentBLLMock.Object, null);

            // Act
            var res = controller.GetAllPayments();

            // Assert
            _mocks.Verify();
            Assert.AreEqual(res.Value.Count(), 2);
            Assert.IsInstanceOfType(res.Value, typeof(PaymentModel[]));
        }