Example #1
0
        public void PaymentTableLogicParameterlessConstructorTest1()
        {
            var target = new PaymentTableLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(PaymentTableLogic));
        }
Example #2
0
        public void PaymentTableLogicParameterlessConstructorTest2()
        {
            Mock <IPaymentTableRepository> mockPaymentTableLogic = new Mock <IPaymentTableRepository>();
            PaymentTableLogic target = new PaymentTableLogic(mockPaymentTableLogic.Object);

            Assert.IsInstanceOfType(target, typeof(PaymentTableLogic));
        }
Example #3
0
        public void PaymentTableLogicConstructorTest1()
        {
            var mockPaymentTableRepository = new Mock <IPaymentTableRepository>();
            PaymentTableLogic target       = new PaymentTableLogic(mockPaymentTableRepository.Object);

            Assert.IsInstanceOfType(target, typeof(PaymentTableLogic));
        }
Example #4
0
        public void PaymentTableLogicConstructorTest()
        {
            var target = new PaymentTableLogic();

            //Assert
            Assert.IsInstanceOfType(target, typeof(PaymentTableLogic));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PaymentTableController"/> class.
        /// </summary>
        public PaymentTableController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _paymentTableLogic = new PaymentTableLogic(bubbleDataSource);
        }
Example #6
0
        public void GetPaymentTable()
        {
            var mockPaymentTableLogic    = new Mock <IPaymentTableRepository>();
            PaymentTableContainer result = new PaymentTableContainer();

            mockPaymentTableLogic.Setup(f => f.GetPaymentTable(It.IsAny <ClaimFieldDoc>())).Returns(result);
            PaymentTableLogic target = new PaymentTableLogic(mockPaymentTableLogic.Object);

            PaymentTableContainer actual = target.GetPaymentTable(new ClaimFieldDoc());

            Assert.AreEqual(result, actual);
        }
Example #7
0
        public void IsTableNameExists()
        {
            var        mockPaymentTableLogic = new Mock <IPaymentTableRepository>();
            const bool result = true;

            mockPaymentTableLogic.Setup(f => f.IsTableNameExists(It.IsAny <ClaimFieldDoc>())).Returns(result);
            PaymentTableLogic target = new PaymentTableLogic(mockPaymentTableLogic.Object);

            bool actual = target.IsTableNameExists(new ClaimFieldDoc());

            Assert.AreEqual(result, actual);
        }
Example #8
0
        public void IsTableNameExistsTest()
        {
            // Arrange
            var mockPaymentTableRepository = new Mock <IPaymentTableRepository>();

            mockPaymentTableRepository.Setup(f => f.IsTableNameExists(It.IsAny <ClaimFieldDoc>())).Returns(true);
            PaymentTableLogic target = new PaymentTableLogic(mockPaymentTableRepository.Object);

            //Act
            bool actual = target.IsTableNameExists(null);

            //Assert
            Assert.AreEqual(true, actual);
        }
Example #9
0
        public void GetCustomPaymentTable()
        {
            var repository = new Mock <IPaymentTableRepository>();
            PaymentTableContainer result = new PaymentTableContainer();
            var value = new ClaimFieldDoc {
                ClaimFieldDocId = 10101, ClaimFieldId = 35, PageSetting = new PageSetting {
                    Skip = 0, SortDirection = "", SortField = "", Take = 5
                }
            };

            repository.Setup(
                f => f.GetCustomPaymentTable(value)).Returns(result);
            PaymentTableLogic target = new PaymentTableLogic(repository.Object);

            PaymentTableContainer actual =
                target.GetPaymentTable(value);

            Assert.AreEqual(result, actual);
        }
Example #10
0
        public void GetAllClaimFieldsTest()
        {
            // Arrange
            var mockPaymentTableRepository   = new Mock <IPaymentTableRepository>();
            List <ClaimField> claimFieldList = new List <ClaimField>
            {
                new ClaimField {
                    ClaimFieldDocId = 1, TableName = "ASC Table"
                }
            };

            mockPaymentTableRepository.Setup(f => f.GetAllClaimFields()).Returns(claimFieldList);
            PaymentTableLogic target = new PaymentTableLogic(mockPaymentTableRepository.Object);

            // Act
            List <ClaimField> actual = target.GetAllClaimFields();

            // Assert
            Assert.AreEqual(claimFieldList, actual);
        }