public void SetUp()
        {
            var rangesInWorksheet = new IRange[3][];

            for (int i = 0; i < rangesInWorksheet.Length; i++)
            {
                rangesInWorksheet[i] = A.CollectionOfFake <IRange>(4).ToArray();
                for (int j = 0; j < rangesInWorksheet[i].Length; j++)
                {
                    A.CallTo(() => rangesInWorksheet[i][j].Text).Returns(string.Format("{0} {1}", i + 1, j + 1));
                }
            }

            var range = A.Fake <IRange>();

            for (int i = 0; i < rangesInWorksheet.Length; i++)
            {
                for (int j = 0; j < rangesInWorksheet[i].Length; j++)
                {
                    A.CallTo(() => range[i + 1, j + 1]).Returns(rangesInWorksheet[i][j]);
                }
            }

            _worksheet = A.Fake <IWorksheet>();
            A.CallTo(() => _worksheet.Name).Returns("WorksheetName");
            A.CallTo(() => _worksheet.Cells).Returns(range);

            _sut = ExcelReaderFactory.CreateExcelReader();
        }
Esempio n. 2
0
        public string GetContent()
        {
            ExcelReader excelReader = ExcelReaderFactory.CreateExcelReader();

            return(CurrentConverter.GetConvertedContent(excelReader.GetExcelTable(ExcelProperties.Instance.Worksheet, ExcelProperties.Instance.Selection)));
        }