MockCursor Class

Definition

A mock android.database.Cursor class that isolates the test code from real Cursor implementation.

[Android.Runtime.Register("android/test/mock/MockCursor", DoNotGenerateAcw=true)]
public class MockCursor : Java.Lang.Object, Android.Database.ICursor, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/test/mock/MockCursor", DoNotGenerateAcw=true)>]
type MockCursor = class
    inherit Object
    interface ICursor
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
MockCursor
Attributes
Implements

Remarks

A mock android.database.Cursor class that isolates the test code from real Cursor implementation.

All methods including ones related to querying the state of the cursor are are non-functional and throw java.lang.UnsupportedOperationException.

This member is deprecated. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.

Java documentation for android.test.mock.MockCursor.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MockCursor()
MockCursor(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
ColumnCount

Return total number of columns

Count

Returns the numbers of rows in the cursor.

Extras

Returns a bundle of extra values.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasUpdates
IsAfterLast

Returns whether the cursor is pointing to the position after the last row.

IsBeforeFirst

Returns whether the cursor is pointing to the position before the first row.

IsClosed

return true if the cursor is closed

IsFirst

Returns whether the cursor is pointing to the first row.

IsLast

Returns whether the cursor is pointing to the last row.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
NotificationUri

Return the URI at which notifications of changes in this Cursor's data will be delivered, as previously set by SetNotificationUri(ContentResolver, Uri).

PeerReference (Inherited from Object)
Position

Returns the current position of the cursor in the row set.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WantsAllOnMoveCalls

onMove() will only be called across processes if this method returns true.

Methods

AbortUpdates()
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Closes the Cursor, releasing all of its resources and making it completely invalid.

CommitUpdates()
CommitUpdates(IDictionary<Long,IDictionary<String,Object>>)
CopyStringToBuffer(Int32, CharArrayBuffer)

Retrieves the requested column text and stores it in the buffer provided.

Deactivate()

Deactivates the Cursor, making all calls on it fail until Requery() is called.

DeleteRow()
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetBlob(Int32)

Returns the value of the requested column as a byte array.

GetColumnIndex(String)

Returns the zero-based index for the given column name, or -1 if the column doesn't exist.

GetColumnIndexOrThrow(String)

Returns the zero-based index for the given column name, or throws IllegalArgumentException if the column doesn't exist.

GetColumnName(Int32)

Returns the column name at the given zero-based column index.

GetColumnNames()

Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.

GetDouble(Int32)

Returns the value of the requested column as a double.

GetFloat(Int32)

Returns the value of the requested column as a float.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInt(Int32)

Returns the value of the requested column as an int.

GetLong(Int32)

Returns the value of the requested column as a long.

GetShort(Int32)

Returns the value of the requested column as a short.

GetString(Int32)

Returns the value of the requested column as a String.

GetType(Int32)

Returns data type of the given column's value.

IsNull(Int32)

Returns true if the value in the indicated column is null.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Move(Int32)

Move the cursor by a relative amount, forward or backward, from the current position.

MoveToFirst()

Move the cursor to the first row.

MoveToLast()

Move the cursor to the last row.

MoveToNext()

Move the cursor to the next row.

MoveToPosition(Int32)

Move the cursor to an absolute position.

MoveToPrevious()

Move the cursor to the previous row.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RegisterContentObserver(ContentObserver)

Register an observer that is called when changes happen to the content backing this cursor.

RegisterDataSetObserver(DataSetObserver)

Register an observer that is called when changes happen to the contents of the this cursors data set, for example, when the data set is changed via Requery(), Deactivate(), or Close().

Requery()

Performs the query that created the cursor again, refreshing its contents.

Respond(Bundle)

This is an out-of-band way for the the user of a cursor to communicate with the cursor.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetNotificationUri(ContentResolver, Uri)

Register to watch a content URI for changes.

SupportsUpdates()
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterContentObserver(ContentObserver)

Unregister an observer that has previously been registered with this cursor via RegisterContentObserver(ContentObserver).

UnregisterDataSetObserver(DataSetObserver)

Unregister an observer that has previously been registered with this cursor via RegisterContentObserver(ContentObserver).

UnregisterFromRuntime() (Inherited from Object)
UpdateBlob(Int32, Byte[])
UpdateDouble(Int32, Double)
UpdateFloat(Int32, Single)
UpdateInt(Int32, Int32)
UpdateLong(Int32, Int64)
UpdateShort(Int32, Int16)
UpdateString(Int32, String)
UpdateToNull(Int32)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to