public async Task <ICreditCard> updateCreditCard(ICreditCard cc) { using (var conn = new SQLiteConnection(_connectionString)) { conn.Open(); var sqlstr = @"UPDATE Creditcard set created = " + cc.GetCreated() + "lastused = " + cc.GetLastUsed() + "pin = " + cc.GetPinCode() + "wrongpincodeattemps = " + cc.GetWrongPinCodeAttemps() + "account = " + cc.GetAccount().GetId() + "blocked = " + cc.IsBlocked() + "WHERE id = " + cc.GetId() + ";"; var command = new SQLiteCommand(sqlstr, conn); await command.ExecuteNonQueryAsync(); } return(cc); }
public void getId_Emptyvalue_returnId0() { var actual = cc.GetId(); Assert.That(actual, Is.EqualTo(0)); // null for ints => 0 }