예제 #1
0
 public void Read_from_spreadsheet_row(ICellRow cell_set)
 {
     Date        = DateTime.FromOADate((double)cell_set.Read_cell(DateIndex));
     Reference   = (String)cell_set.Read_cell(ReferenceIndex);
     Description = ((String)cell_set.Read_cell(DescriptionIndex)).Strip_enclosing_quotes();
     Amount      = (Double)cell_set.Read_cell(AmountIndex);
 }
예제 #2
0
        public void M_CanReadLastRowOfSpecifiedWorksheetAsObjectList()
        {
            // Arrange
            var sheet_name    = "MockSheet";
            var fake_cell_row = new FakeCellRow().With_fake_data(new List <object>
            {
                "22/03/2018",
                "22.34",
                "last row",
                "7788"
            });
            var mock_spreadsheet_repo = new Mock <ISpreadsheetRepo>();

            mock_spreadsheet_repo.Setup(x => x.Read_last_row(sheet_name))
            .Returns(fake_cell_row);
            var spreadsheet = new Spreadsheet(mock_spreadsheet_repo.Object);

            // Act
            ICellRow actual_row = spreadsheet.Read_last_row(sheet_name);

            // Assert
            Assert.AreEqual(fake_cell_row.Read_cell(0), actual_row.Read_cell(0));
            Assert.AreEqual(fake_cell_row.Read_cell(1), actual_row.Read_cell(1));
            Assert.AreEqual(fake_cell_row.Read_cell(2), actual_row.Read_cell(2));
            Assert.AreEqual(fake_cell_row.Read_cell(3), actual_row.Read_cell(3));
        }
 public void Read_from_spreadsheet_row(ICellRow cells)
 {
     Date        = DateTime.FromOADate((double)cells.Read_cell(0));
     Amount      = (Double)cells.Read_cell(1);
     Description = (String)cells.Read_cell(2);
     Index       = Convert.ToInt16((Double)cells.Read_cell(3));
 }
예제 #4
0
 public void Read_from_spreadsheet_row(ICellRow cell_set)
 {
     LastTransactionMarker = ((String)cell_set.Read_cell(LastTransactionMarkerSpreadsheetIndex)).Strip_enclosing_quotes();
     Date        = DateTime.FromOADate((double)cell_set.Read_cell(DateSpreadsheetIndex));
     Type        = (String)cell_set.Read_cell(TypeSpreadsheetIndex);
     Description = ((String)cell_set.Read_cell(DescriptionSpreadsheetIndex)).Strip_enclosing_quotes();
     Amount      = (Double)cell_set.Read_cell(AmountSpreadsheetIndex);
 }
예제 #5
0
 public void Read_from_spreadsheet_row(ICellRow cell_set)
 {
     Date        = DateTime.FromOADate((double)cell_set.Read_cell(DateIndex));
     Type        = (String)cell_set.Read_cell(TypeIndex);
     Description = (String)cell_set.Read_cell(DescriptionIndex);
     Amount      = (Double)cell_set.Read_cell(AmountIndex);
     Balance     = (Double)cell_set.Read_cell(BalanceIndex);
 }
        public void Read_from_spreadsheet_row(ICellRow cell_set)
        {
            Date = DateTime.FromOADate((double)cell_set.Read_cell(DateIndex));
            Unreconciled_amount = cell_set.Read_cell(UnreconciledAmountIndex) != null ? (Double)cell_set.Read_cell(UnreconciledAmountIndex) : 0;
            Description         = (String)cell_set.Read_cell(DescriptionIndex);
            Reconciled_amount   = cell_set.Count > ReconciledAmountIndex && cell_set.Read_cell(ReconciledAmountIndex) != null
                ? (Double)cell_set.Read_cell(ReconciledAmountIndex)
                : 0;

            Source_line = To_string(_separator, false);
        }
        public void Read_from_spreadsheet_row(ICellRow cell_set)
        {
            Date = DateTime.FromOADate((double)cell_set.Read_cell(DateIndex));
            Unreconciled_amount = cell_set.Read_cell(UnreconciledAmountIndex) != null
                ? (Double)cell_set.Read_cell(UnreconciledAmountIndex)
                : 0;
            Type          = (String)cell_set.Read_cell(TypeIndex);
            Description   = (String)cell_set.Read_cell(DescriptionIndex);
            Cheque_number = cell_set.Count > ChequeNumberIndex && cell_set.Read_cell(ChequeNumberIndex) != null
                ? Convert.ToInt32((Double)cell_set.Read_cell(ChequeNumberIndex))
                : 0;

            Reconciled_amount = cell_set.Count > ReconciledAmountIndex && cell_set.Read_cell(ReconciledAmountIndex) != null
                ? (Double)cell_set.Read_cell(ReconciledAmountIndex)
                : 0;

            Source_line = To_string(_separator, false);
        }
        public void Read_from_spreadsheet_row(ICellRow cell_row)
        {
            Date = DateTime.FromOADate(cell_row.Read_cell(DateIndex) != null
                ? (double)cell_row.Read_cell(DateIndex)
                : 0);
            Unreconciled_amount = cell_row.Count > UnreconciledAmountIndex && cell_row.Read_cell(UnreconciledAmountIndex) != null
                ? (Double)cell_row.Read_cell(UnreconciledAmountIndex)
                : 0;
            Code = (String)cell_row.Read_cell(CodeIndex);
            Reconciled_amount = cell_row.Count > ReconciledAmountIndex && cell_row.Read_cell(ReconciledAmountIndex) != null
                ? (Double)cell_row.Read_cell(ReconciledAmountIndex)
                : 0;
            Date_paid = DateTime.FromOADate(cell_row.Read_cell(DatePaidIndex) != null
                ? (double)cell_row.Read_cell(DatePaidIndex)
                : 0);
            Total_paid = cell_row.Count > TotalPaidIndex && cell_row.Read_cell(TotalPaidIndex) != null
                ? (Double)cell_row.Read_cell(TotalPaidIndex)
                : 0;
            Description = (String)cell_row.Read_cell(DescriptionIndex);

            Source_line = To_string(_separator, false);
        }