Skip to content

Commit

Permalink
Tidy up these unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Aug 16, 2019
1 parent 8f831fd commit baaf3ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tests/Tests3.fs
Expand Up @@ -526,14 +526,16 @@ type AltCoverTests3() =
try
Visitor.inputDirectories.Clear()
let options = Main.DeclareOptions()
let unique = Guid.NewGuid().ToString()
let input = [| "-i"; unique; "-i"; unique |]
let here = Path.GetFullPath(".")
let input = [| "-i"; here; "-i"; here |]
let parse = CommandLine.ParseCommandLine input options
match parse with
| Right _ -> Assert.Fail()
| Left(x, y) ->
Assert.That(y, Is.SameAs options)
Assert.That(x, Is.EqualTo "UsageError")
Assert.That(CommandLine.error,
Is.EquivalentTo ([here + " was already specified for --inputDirectory"]))
finally
Visitor.inputDirectories.Clear()

Expand Down Expand Up @@ -600,6 +602,8 @@ type AltCoverTests3() =
| Left(x, y) ->
Assert.That(y, Is.SameAs options)
Assert.That(x, Is.EqualTo "UsageError")
Assert.That(CommandLine.error,
Is.EquivalentTo ([Path.GetFullPath(unique) + " was already specified for --outputDirectory"]))
finally
Visitor.outputDirectories.Clear()

Expand Down

0 comments on commit baaf3ff

Please sign in to comment.