Пример #1
0
        public void IsDefined_WhenConstantIsDefined_ReturnsTrue()
        {
            var preprocessor = new XmlPreprocessor();

            preprocessor.Define("CONSTANT");

            Assert.IsTrue(preprocessor.IsDefined("CONSTANT"));
        }
Пример #2
0
        public void Preprocess_WhenNewDefinesCreatedWithExcessWhitespaceDuringPreprocessing_TrimsAndSavesThem()
        {
            var    preprocessor = new XmlPreprocessor();
            string input        = "<root><?define CONSTANT    ?></root>";

            PreprocessString(preprocessor, input);

            Assert.IsTrue(preprocessor.IsDefined("CONSTANT"));
        }
Пример #3
0
        public void Define_WhenConstantAlreadyDefined_DoesNothing()
        {
            var preprocessor = new XmlPreprocessor();

            preprocessor.Define("CONSTANT");

            preprocessor.Define("CONSTANT");

            Assert.IsTrue(preprocessor.IsDefined("CONSTANT"));
        }
Пример #4
0
        public void IsDefined_WhenConstantIsNotDefined_ReturnsFalse()
        {
            var preprocessor = new XmlPreprocessor();

            Assert.IsFalse(preprocessor.IsDefined("CONSTANT"));
        }
Пример #5
0
        public void IsDefined_WhenConstantIsNull_Throws()
        {
            var preprocessor = new XmlPreprocessor();

            Assert.Throws <ArgumentNullException>(() => preprocessor.IsDefined(null));
        }