public void Initialize() { _config = new TableConfig(); _nodes = new List <HtmlNode>(); _mutations = new List <Mutation>(); _css = ""; _instance = new TablePlugin(_config); _elementContext = Substitute.For <IElementContext>(); _elementContext .When(x => x.AddNode(Arg.Any <HtmlNode>())) .Do(x => _nodes.Add(x.ArgAt <HtmlNode>(0))); _elementContext .When(x => x.AddMutation(Arg.Any <Mutation>())) .Do(x => _mutations.Add(x.Arg <Mutation>())); _globalContext = Substitute.For <IGlobalContext>(); _globalContext .When(x => x.AddCss(Arg.Any <string>())) .Do(x => _css += x.ArgAt <string>(0)); }