Exemple #1
0
        public void GetAllLetterTemplatesTest()
        {
            //Arrange
            var mockLetterTemplateRepository = new Mock <ILetterTemplateRepository>();
            LetterTemplateContainer result   = new LetterTemplateContainer
            {
                LetterTemplates =
                    new List <LetterTemplate>
                {
                    new LetterTemplate {
                        LetterTemplateId = 1, Name = "Test1", TemplateText = "Letter Text 1"
                    },
                    new LetterTemplate {
                        LetterTemplateId = 2, Name = "Test2", TemplateText = "Letter Text 2"
                    }
                },
                TotalRecords = 200,
                PageSetting  = new PageSetting()
            };

            mockLetterTemplateRepository.Setup(f => f.GetLetterTemplates(It.IsAny <LetterTemplateContainer>()))
            .Returns(result);
            LetterTemplateLogic target = new LetterTemplateLogic(mockLetterTemplateRepository.Object);

            //Act
            LetterTemplateContainer actual = target.GetLetterTemplates(null);

            //Assert
            Assert.AreEqual(result, actual);
        }
        public void GetLetterTemplates()
        {
            var mockLetterTemplateLogic    = new Mock <ILetterTemplateRepository>();
            LetterTemplateContainer result = new LetterTemplateContainer();

            mockLetterTemplateLogic.Setup(f => f.GetLetterTemplates(It.IsAny <LetterTemplateContainer>()))
            .Returns(result);
            LetterTemplateLogic     target = new LetterTemplateLogic(mockLetterTemplateLogic.Object);
            LetterTemplateContainer actual = target.GetLetterTemplates(new LetterTemplateContainer());

            Assert.AreEqual(result, actual);
        }
 public LetterTemplateContainer GetAll(LetterTemplateContainer letterTemplateInfo)
 {
     return(_letterTemplateLogic.GetLetterTemplates(letterTemplateInfo));
 }