public void ThenICanGetAllExcelRangeProperties() { //ExcelInteropHelper.GetCellProperties(5, 1); ExcelInteropHelper.ActivateSheet("RiskRegisterWithScope"); var bgColorProperty = ExcelInteropHelper.ReadExcelRangeProperty("H5:S5", ExcelCellProperties.CellBackGroundColor); var fontColorProperty = ExcelInteropHelper.ReadExcelRangeProperty("H5:S5", ExcelCellProperties.CellFontColor); var fontSizeProperty = ExcelInteropHelper.ReadExcelRangeProperty("H5:S5", ExcelCellProperties.CellFontSize); var formulaProperty = ExcelInteropHelper.ReadExcelRangeProperty("H5:S5", ExcelCellProperties.CellFormula); var textProperty = ExcelInteropHelper.ReadExcelRangeProperty("H5:S5", ExcelCellProperties.CellText); int index = 0; foreach (var text in textProperty) { if (Convert.ToInt32(text) < 2) { Assert.AreEqual("ffffff", bgColorProperty[index]); } else if (Convert.ToInt32(text) >= 2 && Convert.ToInt32(text) < 5) { Assert.AreEqual("ffffff", bgColorProperty[index]); } else if (Convert.ToInt32(text) >= 5) { Assert.AreEqual("a31e22", bgColorProperty[index]); } index++; } }
public void ThenICanActivateWorksheetsByNameIndex() { ExcelInteropHelper.ActivateSheet(); Assert.AreEqual("Test1", ExcelInteropHelper.GetActiveSheetName()); ExcelInteropHelper.ActivateSheet(2); Assert.AreEqual("Test2", ExcelInteropHelper.GetActiveSheetName()); ExcelInteropHelper.ActivateSheet("Test1"); Assert.AreEqual("Test1", ExcelInteropHelper.GetActiveSheetName()); }
public void ThenICanAllExcelCellProperties() { ExcelInteropHelper.ActivateSheet("RiskRegisterWithScope"); ExcelInteropHelper.GetCellProperties(5, 8); string bgColor = ExcelCellProperties.BackGroundColor; string fontColor = ExcelCellProperties.FontColor; string fontSize = ExcelCellProperties.FontSize; string formula = ExcelCellProperties.Formula; string text = ExcelCellProperties.Text; ExcelInteropHelper.GetCellProperties("H5"); bgColor = ExcelCellProperties.BackGroundColor; }
public void GivenIHaveMacroEnabledWorkbook() { ExcelInteropHelper.ActivateSheet(); }
public void ThenICanReadChartValues() { ExcelInteropHelper.ActivateSheet("IP (1) Process design or execut"); ExcelInteropHelper.ReadExcelChart(); }
public void GivenIHaveValidWorkbook() { ExcelInteropHelper.ActivateSheet(); }