Created
February 27, 2012 02:48
-
-
Save colinbowern/1920943 to your computer and use it in GitHub Desktop.
AutoData Theories with AutoFixture and XUnit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using FluentAssertions; | |
using Ploeh.AutoFixture.Xunit; | |
using Xunit.Extensions; | |
namespace XunitSample | |
{ | |
public class TestClass | |
{ | |
[Theory, AutoData] | |
public void TestMethod1(string foo) | |
{ | |
foo.Should().NotBeEmpty(); | |
} | |
[Theory, AutoData] | |
public void TestMethod2(Foo foo) | |
{ | |
foo.Bar.Should().NotBeEmpty(); | |
} | |
} | |
public class Foo | |
{ | |
public string Bar { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment