public void ShouldBeOneOf() { DocExampleWriter.Document(() => { var apu = new Person { Name = "Apu" }; var homer = new Person { Name = "Homer" }; var skinner = new Person { Name = "Skinner" }; var barney = new Person { Name = "Barney" }; var theBeSharps = new List <Person> { homer, skinner, barney }; apu.ShouldBeOneOf(theBeSharps.ToArray()); }, _testOutputHelper); }
public void ShouldAllBeEqual() { DocExampleWriter.Document(() => { var lisa = new Person() { Name = "Lisa" }; var bart = new Person() { Name = "Bart" }; var maggie = new Person() { Name = "Maggie" }; var simpsonsKids = new List <Person>() { bart, lisa, maggie, maggie }; simpsonsKids.ShouldAllBeEqual(); }, _testOutputHelper); }
public void ShouldNotContain() { DocExampleWriter.Document(() => { var homerSimpson = new Person { Name = "Homer" }; var homerGlumplich = new Person { Name = "Homer" }; var lenny = new Person { Name = "Lenny" }; var carl = new Person { Name = "carl" }; var clubOfNoHomers = new List <Person> { homerSimpson, homerGlumplich, lenny, carl }; clubOfNoHomers.ShouldNotContain(homerSimpson); }, _testOutputHelper); }
public void Enumerables() { DocExampleWriter.Document(() => { var apu = new Person { Name = "Apu" }; var homer = new Person { Name = "Homer" }; var skinner = new Person { Name = "Skinner" }; var barney = new Person { Name = "Barney" }; var theBeSharps = new List <Person> { homer, skinner, barney }; theBeSharps.ShouldBe(new[] { apu, homer, skinner, barney }); }, _testOutputHelper); }
public void ShouldNotContain_Predicate() { DocExampleWriter.Document(() => { var mrBurns = new Person() { Name = "Mr.Burns", Salary = 3000000 }; var kentBrockman = new Person() { Name = "Homer", Salary = 3000000 }; var homer = new Person() { Name = "Homer", Salary = 30000 }; var millionares = new List <Person>() { mrBurns, kentBrockman, homer }; millionares.ShouldNotContain(m => m.Salary < 1000000); }, _testOutputHelper); }
public void ShouldContain() { DocExampleWriter.Document(() => { var mrBurns = new Person() { Name = "Mr.Burns", Salary = 3000000 }; var kentBrockman = new Person() { Name = "Kent Brockman", Salary = 3000000 }; var homer = new Person() { Name = "Homer", Salary = 30000 }; var millionares = new List <Person>() { kentBrockman, homer }; millionares.ShouldContain(mrBurns); }, _testOutputHelper); }
public void ShouldThrowFunc() { DocExampleWriter.Document(() => { Should.Throw <ArgumentNullException>(() => new Person("Homer")); }, _testOutputHelper); }
public void ShouldNotBeSameAs() { DocExampleWriter.Document(() => { }, _testOutputHelper); }