Permit public mocks (#94)

This commit is contained in:
Patrick Stevens
2024-02-13 19:58:30 +00:00
committed by GitHub
parent 8bd13c0bb4
commit c3af52596f
6 changed files with 103 additions and 13 deletions

View File

@@ -13,8 +13,14 @@ type RemoveOptionsAttribute () =
/// This generator creates a record which implements the interface,
/// but where each method is represented as a record field, so you can use
/// record update syntax to easily specify partially-implemented mock objects.
type GenerateMockAttribute () =
/// You may optionally specify `isInternal = false` to get a mock with the public visibility modifier.
type GenerateMockAttribute (isInternal : bool) =
inherit Attribute ()
/// The default value of `isInternal`, the optional argument to the GenerateMockAttribute constructor.
static member DefaultIsInternal = true
/// Shorthand for the "isExtensionMethod = false" constructor; see documentation there for details.
new () = GenerateMockAttribute GenerateMockAttribute.DefaultIsInternal
/// Attribute indicating a record type to which the "Add JSON serializer" Myriad
/// generator should apply during build.