Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class Failure

    Objects that represent fail-able conditions. Objects of a derived class are created and registered with the mock directory. After register, each object will be invoked once for each first write of a file, giving the object a chance to throw an IOException.

    Inheritance
    object
    Failure
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public class Failure

    Fields

    m_doFail

    Objects that represent fail-able conditions. Objects of a derived class are created and registered with the mock directory. After register, each object will be invoked once for each first write of a file, giving the object a chance to throw an IOException.

    Declaration
    protected bool m_doFail
    Field Value
    Type Description
    bool

    Methods

    ClearDoFail()

    Objects that represent fail-able conditions. Objects of a derived class are created and registered with the mock directory. After register, each object will be invoked once for each first write of a file, giving the object a chance to throw an IOException.

    Declaration
    public virtual void ClearDoFail()

    Eval(MockDirectoryWrapper)

    Eval is called on the first write of every new file.

    Declaration
    public virtual void Eval(MockDirectoryWrapper dir)
    Parameters
    Type Name Description
    MockDirectoryWrapper dir

    Reset()

    Reset should set the state of the failure to its default (freshly constructed) state. Reset is convenient for tests that want to create one failure object and then reuse it in multiple cases. This, combined with the fact that Failure subclasses are often anonymous classes makes reset difficult to do otherwise.

    A typical example of use is
    Failure failure = new Failure() { ... };
    ...
    mock.FailOn(failure.Reset())
    Declaration
    public virtual Failure Reset()
    Returns
    Type Description
    Failure

    SetDoFail()

    Objects that represent fail-able conditions. Objects of a derived class are created and registered with the mock directory. After register, each object will be invoked once for each first write of a file, giving the object a chance to throw an IOException.

    Declaration
    public virtual void SetDoFail()
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.