Skip to content

Cannot mock bulk reponse items anymore #8632

@zarkin-dev

Description

@zarkin-dev

9.0.7:

9.0.4:

8:

Mocking bulk indexing responses for unit tests is no longer possible:

The class definition of BulkIndexResponseItem changed from having no explicit constructors in 8.x to having a single explicit internally scoped constructor. This prevents us from writing unit tests, as there is no publicly accessible constructor
public sealed class BulkIndexResponseItem : ResponseItem { public override string Operation => "index"; //Prevents public constructor from being created. [SetsRequiredMembers] internal BulkIndexResponseItem(JsonConstructorSentinel sentinel) : base(sentinel) { } }

Expected behavior
Provide a parameterless constructor for supporting unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions