Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3347

IGetResult shouldn't have an internal Status property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.4.5
    • 3.4.3
    • library
    • None
    • 0
    • SDK10

    Description

      In 3.4.3 an internal Status property was added to IGetResult to help support the new ITryGetResult interface. However, this makes it very difficult to mock IGetResult. Any implementation of IGetResult must implement the property, but implementations generally can't do so because it's internal.

      Instead, we should probably only have the property on the `GetResult` class and not on `IGetResult`. Alternatively, we could make the property public.

      Possible workaround for 3.4.3: Implement a reverse bypass on internals using System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute and then hand-build an implementation. This attribute is not public, however, so you must manually define a copy of it in the unit test library. And it won't work with Moq, or at least would be difficult to make work with Moq, because it wouldn't be present on the dynamically generated assembly.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jmorris Jeff Morris
            btburnett3 Brant Burnett
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty