public void AddTable_Test() { var table = Doc2web.Tests.Samples.TableSimple.Build3x3(); var grid = new GridState(); _gridStateFactory.Build(Arg.Is(table), Arg.Is(0)).Returns(grid); var result = _instance.AddTable(table, 0); Assert.AreSame(grid, result); }
public void Initialize() { _nameGen = new NameGenerator() { Prefix = "t" }; _gridStateFactory = Substitute.For <IGridStateFactory>(); _gridStateFactory .Build(Arg.Any <Table>(), Arg.Any <int>()) .Returns(x => new GridState() { VNode = new VNode("div", "", x.Arg <int>()), ClsName = _nameGen.Generate(), CellsMatrix = new CellState[, ] { } }); _instance = new TableContext { GridStateFactory = _gridStateFactory }; }