public void RangeCase7Test() { var mwb = MockWorkbook.standardMockWorkbook(); var e = mwb.envForSheet(1); String s = "A1,A2:A3,A4"; AddrPair[] addrpairs = { new AddrPair( AST.Address.fromA1withMode(1, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1withMode(1, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path) ), new AddrPair( AST.Address.fromA1withMode(2, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1withMode(3, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path) ), new AddrPair( AST.Address.fromA1withMode(4, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1withMode(4, "A", AST.AddressMode.Relative, AST.AddressMode.Relative, e.WorksheetName, e.WorkbookName, e.Path) ) }; AST.Reference r = Parcel.simpleReferenceParser(s, e); AST.Reference correct = new AST.ReferenceRange(e, new AST.Range(addrpairs)); Assert.AreEqual(r, correct); }
public void standardRange() { var mwb = MockWorkbook.standardMockWorkbook(); var e = mwb.envForSheet(1); String s = "A3:B22"; AST.Reference r = Parcel.simpleReferenceParser(s, e); AST.Reference correct = new AST.ReferenceRange(e, new AST.Range(Utility.makeAddressForA1("A", 3, e), Utility.makeAddressForA1("B", 22, e)) ); Assert.AreEqual(r, correct); }
public void mixedRangeTest2() { var mwb = MockWorkbook.standardMockWorkbook(); var e = mwb.envForSheet(1); String s = "A$1:B$1"; AST.Range range = new AST.Range( AST.Address.fromA1withMode(1, "A", AST.AddressMode.Absolute, AST.AddressMode.Relative, e.WorkbookName, e.WorkbookName, e.Path), AST.Address.fromA1withMode(1, "B", AST.AddressMode.Absolute, AST.AddressMode.Relative, e.WorkbookName, e.WorkbookName, e.Path) ); AST.Reference r = Parcel.simpleReferenceParser(s, e); AST.Reference correct = new AST.ReferenceRange(e, range); Assert.AreEqual(r, correct); }
public void RangeCase1Test() { var mwb = MockWorkbook.standardMockWorkbook(); var e = mwb.envForSheet(1); String s = "A1:A2"; AST.Reference r = Parcel.simpleReferenceParser(s, e); AST.Reference correct = new AST.ReferenceRange( e, new AST.Range( AST.Address.fromA1(1, "A", e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1(2, "A", e.WorksheetName, e.WorkbookName, e.Path) ) ); Assert.AreEqual(r, correct); }
public void RangeCase7Test() { var mwb = MockWorkbook.standardMockWorkbook(); var e = mwb.envForSheet(1); String s = "A1,A2:A3,A4"; AddrPair[] addrpairs = { new AddrPair( AST.Address.fromA1(1, "A", e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1(1, "A", e.WorksheetName, e.WorkbookName, e.Path) ), new AddrPair( AST.Address.fromA1(2, "A", e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1(3, "A", e.WorksheetName, e.WorkbookName, e.Path) ), new AddrPair( AST.Address.fromA1(4, "A", e.WorksheetName, e.WorkbookName, e.Path), AST.Address.fromA1(4, "A", e.WorksheetName, e.WorkbookName, e.Path) ) }; AST.Reference r = Parcel.simpleReferenceParser(s, e); AST.Reference correct = new AST.ReferenceRange(e, new AST.Range(addrpairs)); Assert.AreEqual(r, correct); }