public void GetAllPayments_Returns_PaymentDtoArray() { // Arrange var dbContextMock = _mocks.Create<IDatabaseContext>(); dbContextMock.Setup(m => m.GetAll<PaymentDto>()) .Returns(new PaymentDto[] { new PaymentDto(), new PaymentDto() }); var paymentBLL = new PaymentBLL(dbContextMock.Object, null); // Act var res = paymentBLL.GetAllPayments(); // Assert _mocks.Verify(); Assert.AreEqual(res.Count(), 2); Assert.IsInstanceOfType(res, typeof(PaymentDto[])); }