Stamp out records corresponding to interfaces (#56)

This commit is contained in:
Patrick Stevens
2023-12-30 23:41:27 +00:00
committed by GitHub
parent ed0e4da0a3
commit ff2c08d54f
19 changed files with 852 additions and 246 deletions

View File

@@ -0,0 +1,5 @@
namespace ConsumePlugin.AssemblyInfo
[<assembly : System.Runtime.CompilerServices.InternalsVisibleTo("WoofWare.Myriad.Plugins.Test")>]
do ()

View File

@@ -10,21 +10,26 @@
<ItemGroup>
<None Include="myriad.toml"/>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="RecordFile.fs"/>
<Compile Include="GeneratedRecord.fs"> <!--1-->
<MyriadFile>RecordFile.fs</MyriadFile> <!--2-->
<Compile Include="GeneratedRecord.fs">
<MyriadFile>RecordFile.fs</MyriadFile>
</Compile>
<Compile Include="JsonRecord.fs"/>
<Compile Include="GeneratedJson.fs"> <!--1-->
<MyriadFile>JsonRecord.fs</MyriadFile> <!--2-->
<Compile Include="GeneratedJson.fs">
<MyriadFile>JsonRecord.fs</MyriadFile>
</Compile>
<Compile Include="PureGymDto.fs"/>
<Compile Include="GeneratedPureGymDto.fs">
<MyriadFile>PureGymDto.fs</MyriadFile> <!--2-->
<MyriadFile>PureGymDto.fs</MyriadFile>
</Compile>
<Compile Include="RestApiExample.fs"/>
<Compile Include="GeneratedRestClient.fs">
<MyriadFile>RestApiExample.fs</MyriadFile> <!--2-->
<MyriadFile>RestApiExample.fs</MyriadFile>
</Compile>
<Compile Include="MockExample.fs"/>
<Compile Include="GeneratedMock.fs">
<MyriadFile>MockExample.fs</MyriadFile>
</Compile>
<None Include="..\runmyriad.sh">
<Link>runmyriad.sh</Link>

View File

@@ -3,6 +3,7 @@
// Changes to this file will be lost when the code is regenerated.
//------------------------------------------------------------------------------
namespace ConsumePlugin
/// Module containing JSON parsing methods for the InnerType type

View File

@@ -0,0 +1,74 @@
//------------------------------------------------------------------------------
// This code was generated by myriad.
// Changes to this file will be lost when the code is regenerated.
//------------------------------------------------------------------------------
namespace SomeNamespace
/// Mock record type for an interface
type internal PublicTypeMock =
{
Mem1 : string * int -> string list
Mem2 : string -> int
}
static member Empty : PublicTypeMock =
{
Mem1 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
Mem2 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
}
interface IPublicType with
member this.Mem1 (arg0, arg1) = this.Mem1 (arg0, arg1)
member this.Mem2 (arg0) = this.Mem2 (arg0)
namespace SomeNamespace
/// Mock record type for an interface
type internal InternalTypeMock =
{
Mem1 : string * int -> unit
Mem2 : string -> int
}
static member Empty : InternalTypeMock =
{
Mem1 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
Mem2 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
}
interface InternalType with
member this.Mem1 (arg0, arg1) = this.Mem1 (arg0, arg1)
member this.Mem2 (arg0) = this.Mem2 (arg0)
namespace SomeNamespace
/// Mock record type for an interface
type private PrivateTypeMock =
{
Mem1 : string * int -> unit
Mem2 : string -> int
}
static member Empty : PrivateTypeMock =
{
Mem1 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
Mem2 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
}
interface PrivateType with
member this.Mem1 (arg0, arg1) = this.Mem1 (arg0, arg1)
member this.Mem2 (arg0) = this.Mem2 (arg0)
namespace SomeNamespace
/// Mock record type for an interface
type internal VeryPublicTypeMock<'a, 'b> =
{
Mem1 : 'a -> 'b
}
static member Empty<'a, 'b> () : VeryPublicTypeMock<'a, 'b> =
{
Mem1 = (fun x -> raise (System.NotImplementedException "Unimplemented mock function"))
}
interface VeryPublicType<'a, 'b> with
member this.Mem1 (arg0) = this.Mem1 (arg0)

View File

@@ -3,6 +3,7 @@
// Changes to this file will be lost when the code is regenerated.
//------------------------------------------------------------------------------
namespace PureGym
/// Module containing JSON parsing methods for the GymOpeningHours type

View File

@@ -4,6 +4,7 @@
//------------------------------------------------------------------------------
namespace PureGym
open System

View File

@@ -0,0 +1,22 @@
namespace SomeNamespace
open WoofWare.Myriad.Plugins
[<GenerateMock>]
type IPublicType =
abstract Mem1 : string * int -> string list
abstract Mem2 : string -> int
[<GenerateMock>]
type internal InternalType =
abstract Mem1 : string * int -> unit
abstract Mem2 : string -> int
[<GenerateMock>]
type private PrivateType =
abstract Mem1 : string * int -> unit
abstract Mem2 : string -> int
[<GenerateMock>]
type VeryPublicType<'a, 'b> =
abstract Mem1 : 'a -> 'b