I have a Visual Studio 2012 Project and the following NuGet Packages installed:
- AutoFixture with Auto Mocking using Moq
- Autofixture with xUnit.net data theories
- AutoFixture
- Moq
- xUnit.net: Extensions
- xUnit.net: Runners
- xUnit.net
Given the following contrived Logger class (Logger.fs):
namespace FUnit
type public ILoggerContext =
abstract member LogPath :string
type public LoggerContext (logPath :string) =
member val LogPath = logPath with get, set
interface ILoggerContext with
member this.LogPath = this.LogPath
type public Logger () =
member this.Log (context: ILoggerContext) value =
System.String.Format("Logged {0} to {1}.", value, context.LogPath)
and the following unit test:
namespace FUnit.Test
open FUnit
type public Math_Add() =
[<Xunit.Extensions.Theory>]
[<Ploeh.AutoFixture.Xunit.AutoData>]
member this.``Should Output Value And Path`` (path :string) =
let context = new LoggerContext(path)
let logger = new Logger()
let expected = System.String.Format("Logged value to {0}.", path)
let actual = logger.Log context "value"
Xunit.Assert.Equal<string>(expected, actual)
The Test Explorer does not recognize the unit test after ensuring I'm showing all tests and building the project. The project builds correctly with no errors or warnings in the Build, General, or Test output logs.
If I replace the current Theory and AutoData attributes with an Fact attribute, the test shows up.
Is AutoFixture supported in F# test projects? Can anyone else replicate this and know what I'm doing wrong?