public void IsDefined_WhenConstantIsDefined_ReturnsTrue() { var preprocessor = new XmlPreprocessor(); preprocessor.Define("CONSTANT"); Assert.IsTrue(preprocessor.IsDefined("CONSTANT")); }
public void Preprocess_WhenNewDefinesCreatedWithExcessWhitespaceDuringPreprocessing_TrimsAndSavesThem() { var preprocessor = new XmlPreprocessor(); string input = "<root><?define CONSTANT ?></root>"; PreprocessString(preprocessor, input); Assert.IsTrue(preprocessor.IsDefined("CONSTANT")); }
public void Define_WhenConstantAlreadyDefined_DoesNothing() { var preprocessor = new XmlPreprocessor(); preprocessor.Define("CONSTANT"); preprocessor.Define("CONSTANT"); Assert.IsTrue(preprocessor.IsDefined("CONSTANT")); }
public void IsDefined_WhenConstantIsNotDefined_ReturnsFalse() { var preprocessor = new XmlPreprocessor(); Assert.IsFalse(preprocessor.IsDefined("CONSTANT")); }
public void IsDefined_WhenConstantIsNull_Throws() { var preprocessor = new XmlPreprocessor(); Assert.Throws <ArgumentNullException>(() => preprocessor.IsDefined(null)); }