示例#1
0
        public void BuildPdfShouldThrowErrorWithNullInput()
        {
            //Arrange
            this.configurationSection.Setup(cs => cs.Value).Returns("fakeoutput");
            this.configuration.Setup(c => c.GetSection(It.IsAny <string>())).Returns(configurationSection.Object);

            var expectedErrorMessage = Constants.NO_COMMANDS_TO_PROCESS_ERROR;

            var pdfGenerator = new PdfGenerator(configuration.Object);

            //Act (see Assertion)

            //Assert
            var error = Assert.Throws <ArgumentException>(() => pdfGenerator.BuildPdf(null));

            Assert.AreEqual(expectedErrorMessage, error.Message);
        }