public void Initialize() { _config = new TextProcessorConfig(); _numberingConfig = new NumberingConfig(); _instance = new TextProcessorPlugin(_config); _r = new Run(new Text("Some text.")); _p = new Paragraph(new ParagraphProperties(), _r); _nestingHandler = Substitute.For <IContextNestingHandler>(); _cssRegistrator = Substitute.For <ICssRegistrator>(); _globalContext = Substitute.For <IGlobalContext>(); _globalContext.TryResolve(out ICssRegistrator val1).Returns(x => { x[0] = _cssRegistrator; return(true); }); _globalContext.TryResolve(out NumberingConfig val2).Returns(x => { x[0] = _numberingConfig; return(true); }); _cssRegistrator.RegisterParagraph(null, null).ReturnsForAnyArgs(x => new CssClass()); _cssRegistrator.RegisterRun(null, null, null).ReturnsForAnyArgs(x => new CssClass()); _pContext = new RootElementContext(_globalContext, _p) { NestingHandler = _nestingHandler }; _rContext = new ChildElementContext(_pContext) { Element = _r }; }
public void Initialize() { _config = new NumberingConfig(); _instance = new NumberingPlugin(_wpDoc, _config); _level = new Level(); _nodes = new List <HtmlNode>(); _mutations = new List <Mutation>(); }
public void Initialize() { _config = new NumberingConfig(); _numberingMapper = Substitute.For <INumberingMapper>(); _paragraphContext = new ParagraphContext { CustomCss = new CssData(), Parent = new VNode() }; _state = Substitute.For <IElementProcessingState>(); _state.GetContext(out ParagraphContext _).Returns(x => { x[0] = _paragraphContext; return(true); }); _level = new Level(); _instance = new NumberingPlugin(_numberingMapper, _config); }