Skip to content

Instantly share code, notes, and snippets.

@colinbowern
Created February 27, 2012 02:48
Show Gist options
  • Save colinbowern/1920943 to your computer and use it in GitHub Desktop.
Save colinbowern/1920943 to your computer and use it in GitHub Desktop.
AutoData Theories with AutoFixture and XUnit
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