public void SetUp()
 {
     ValidationRepository.GetMandatoryXmlElements().Returns(new List <string>
     {
         "<total>"
     });
 }
        public void MessageContentWithMandatoryXmlElementsDoesNotThrowException(string messageContent)
        {
            List <string> mandatoryXmlElements = new List <string>
            {
                "<test>"
            };

            ValidationRepository.GetMandatoryXmlElements().Returns(mandatoryXmlElements);

            Assert.DoesNotThrow(() => MandatoryXmlElementsValidator.Validate(messageContent));
        }
        public void MessageContentWithMissingMandatoryXmlElementsThrowsException(string messageContent)
        {
            List <string> mandatoryXmlElements = new List <string>
            {
                "<test1>",
                "<test2>"
            };

            ValidationRepository.GetMandatoryXmlElements().Returns(mandatoryXmlElements);

            AssertXmlContentParserExceptionIsThrown(messageContent, mandatoryXmlElements);
        }
        public void MessageContentWithNoContentForMandatoryXmlElementThrowsException()
        {
            List <string> mandatoryXmlElements = new List <string>
            {
                "<test>"
            };

            ValidationRepository.GetMandatoryXmlElements().Returns(mandatoryXmlElements);

            const string messageContent = "<test></test>";

            AssertXmlContentParserExceptionIsThrown(messageContent, mandatoryXmlElements);
        }