示例#1
0
        public static ExcelSpreadsheetRepo One_time_spreadsheet_set_up()
        {
            _numSpreadsheetClients++;

            if (_numSpreadsheetClients == 1)
            {
                _excelSpreadsheet = new ExcelSpreadsheetRepo(Test_spreadsheet_path());
            }

            return(_excelSpreadsheet);
        }
        public void Throws_exception_when_adding_row_to_spreadsheet_already_open()
        {
            // Arrange
            var           second_spreadsheet = new ExcelSpreadsheetRepo(_testSpreadsheetFileNameAndPath);
            bool          exception_thrown   = false;
            TestCsvRecord appended_row       = new TestCsvRecord().Build();

            // Act
            try
            {
                second_spreadsheet.Append_csv_record(TestSheetNames.Test_record, appended_row);
            }
            catch (Exception)
            {
                exception_thrown = true;
            }

            // Assert
            Assert.AreEqual(true, exception_thrown);
        }
 private void Close_and_reopen_spreadsheet()
 {
     _excelSpreadsheet.Dispose();
     _excelSpreadsheet = new ExcelSpreadsheetRepo(_testSpreadsheetFileNameAndPath);
 }
 public void One_time_set_up()
 {
     _excelSpreadsheet = new ExcelSpreadsheetRepo(_testSpreadsheetFileNameAndPath);
 }
 public void One_time_set_up()
 {
     _spreadsheet = new ExcelSpreadsheetRepo(Test_spreadsheet_path());
 }