Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Mar 13, 2024
1 parent 9c87e56 commit ee81c7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions AltCover.Engine/Tasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ type RunSettings() =
Justification = "Unit test accessor")>]
member val internal MessageIO: (string -> unit) option = None with get, set

member val internal GetTempFileName: Func<string> =
Func<string>(Path.GetTempFileName) with get, set
member val internal GetTempFileName: (unit -> string) =
Path.GetTempFileName with get, set

override self.Execute() =
let signal =
Expand All @@ -373,7 +373,7 @@ type RunSettings() =
|> sprintf "Settings Before: %s"
|> signal

let tempFile = self.GetTempFileName.Invoke()
let tempFile = self.GetTempFileName()

try
let settings =
Expand Down
6 changes: 3 additions & 3 deletions AltCover.Tests/Tests3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4464,14 +4464,14 @@ module AltCoverTests3 =
.GetProperty("GetTempFileName", BindingFlags.Instance ||| BindingFlags.NonPublic)

let basic =
temper.GetValue(subject) :?> Func<string>
temper.GetValue(subject) :?> (unit -> string)

let badge =
(fun () ->
let t1 = basic.Invoke()
let t1 = basic ()
Path.Combine(Path.GetDirectoryName t1, "altcover.test." + Path.GetFileName(t1)))

temper.SetValue(subject, Func<string>(badge))
temper.SetValue(subject, badge)
subject

[<Test>]
Expand Down

0 comments on commit ee81c7d

Please sign in to comment.