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

            _appealLetterLogic = new AppealLetterLogic(bubbleDataSource);
        }
Exemplo n.º 2
0
        public void AppealLetterLogicParameterlessConstructorTest2()
        {
            Mock <IAppealLetterRepository> mockAppealLetterLogic = new Mock <IAppealLetterRepository>();
            AppealLetterLogic target = new AppealLetterLogic(mockAppealLetterLogic.Object);

            Assert.IsInstanceOfType(target, typeof(AppealLetterLogic));
        }
Exemplo n.º 3
0
        public void AppealLetterLogicParameterlessConstructorTest1()
        {
            var target = new AppealLetterLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(AppealLetterLogic));
        }
Exemplo n.º 4
0
        public void GetAppealLetter()
        {
            Mock <IAppealLetterRepository> mockAppealLetterLogic = new Mock <IAppealLetterRepository>();
            AppealLetter result = new AppealLetter();

            mockAppealLetterLogic.Setup(f => f.GetAppealLetter(It.IsAny <AppealLetter>())).Returns(result);
            AppealLetterLogic target = new AppealLetterLogic(mockAppealLetterLogic.Object);

            AppealLetter actual = target.GetAppealLetter(new AppealLetter());

            Assert.AreEqual(result, actual);
        }
Exemplo n.º 5
0
        public void GetAppealTemplates()
        {
            Mock <IAppealLetterRepository> mockAppealLetterLogic = new Mock <IAppealLetterRepository>();
            List <LetterTemplate>          result = new List <LetterTemplate>();
            //int facilityId = 3;
            LetterTemplate templateinfo = new LetterTemplate {
                FacilityId = 3
            };

            mockAppealLetterLogic.Setup(f => f.GetAppealTemplates(templateinfo)).Returns(result);
            AppealLetterLogic target = new AppealLetterLogic(mockAppealLetterLogic.Object);

            List <LetterTemplate> actual = target.GetAppealTemplates(templateinfo);

            Assert.AreEqual(result, actual);
        }
Exemplo n.º 6
0
        public void GetAllLetterTemplatesWithoutPaginationTest()
        {
            // Arrange
            var mockAppealLetterRepository        = new Mock <IAppealLetterRepository>();
            List <LetterTemplate> letterTemplates = new List <LetterTemplate>
            {
                new LetterTemplate {
                    LetterTemplateId = 1, Name = "Test Letter 1", TemplateText = "Template Text 1"
                },
                new LetterTemplate {
                    LetterTemplateId = 2, Name = "Test Letter 2", TemplateText = "Template Text 2"
                }
            };

            mockAppealLetterRepository.Setup(f => f.GetAppealTemplates())
            .Returns(letterTemplates);
            AppealLetterLogic target = new AppealLetterLogic(mockAppealLetterRepository.Object);

            //Act
            List <LetterTemplate> actual = target.GetAppealTemplates();

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