FastMoq
Search Results for

    Show / Hide Table of Contents

    Class PropertyValueCapture<TValue>

    Captures property values assigned by a fake or stub during a test.

    Inheritance
    object
    PropertyValueCapture<TValue>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastMoq
    Assembly: FastMoq.Core.dll
    Syntax
    public sealed class PropertyValueCapture<TValue>
    Type Parameters
    Name Description
    TValue

    The captured value type.

    Examples
    var modeCapture = new PropertyValueCapture<string?>();
    
    var sink = new FakeModeSink(modeCapture);
    Mocks.AddType<IModeSink>(sink);
    
    modeCapture.Value.Should().Be("updated");

    Properties

    HasValue

    Gets a value indicating whether any value has been recorded.

    Declaration
    public bool HasValue { get; }
    Property Value
    Type Description
    bool

    History

    Gets the recorded history in assignment order.

    Declaration
    public IReadOnlyList<TValue> History { get; }
    Property Value
    Type Description
    IReadOnlyList<TValue>

    Value

    Gets the most recently recorded value.

    Declaration
    public TValue Value { get; }
    Property Value
    Type Description
    TValue

    Methods

    Clear()

    Clears the recorded history and current value marker.

    Declaration
    public void Clear()

    Record(TValue)

    Records a property assignment.

    Declaration
    public void Record(TValue value)
    Parameters
    Type Name Description
    TValue value

    The assigned value.

    Extension Methods

    ObjectExtensions.RaiseIfNull<T>(T?, string?, string?, int?, string?)
    TestClassExtensions.GetFieldValue<TObject>(TObject, string, TObject?)
    TestClassExtensions.GetField<TObject>(TObject, string)
    TestClassExtensions.GetMemberName<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMember<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMethodValue<TObject>(TObject, string, object?, params object[])
    TestClassExtensions.GetMethod<TObject>(TObject, string)
    TestClassExtensions.GetPropertyValue<TObject>(TObject, string, object?)
    TestClassExtensions.GetProperty<TObject>(TObject, string)
    TestClassExtensions.SetFieldValue<TObject>(TObject, string, object?)
    TestClassExtensions.SetPropertyValue<TObject>(TObject, string, object?)
    MockerHttpMoqExtensions.SetupHttpMessage(object, Func<HttpResponseMessage>, Expression?, Expression?)
    MockerHttpMoqExtensions.SetupMessageAsync<TMock, TReturn>(object, Expression<Func<TMock, Task<TReturn>>>, Func<TReturn>)
    MockerHttpMoqExtensions.SetupMessageProtectedAsync<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessageProtected<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessage<TMock, TReturn>(object, Expression<Func<TMock, TReturn>>, Func<TReturn>)
    TestClassExtensions.GetFieldInfo<TType>(object, string)
    TestClassExtensions.GetFieldValue<T>(object?, FieldInfo)
    TestClassExtensions.GetFieldValue<T, TType>(object, string)
    In this article
    Back to top
    Generated 2026-04-24 22:58 UTC