public void Eagerly_NullChecks() { Action act = () => NullOffspring.Eagerly(); act .Should().Throw <ArgumentNullException>(); }
public void ToPopulation_NullChecks() { Action act = () => NullOffspring.ToPopulation(); act .Should().Throw <ArgumentNullException>(); }
public void SelectSurvivors_NullChecks() { Action act = () => NullOffspring.SelectSurvivors(10); act .Should().Throw <ArgumentNullException>(); }
public void SelectElite_NullChecks() { Action act = () => NullOffspring.SelectElite(2); act .Should().Throw <ArgumentNullException>(); }
public void AddChildren_NullChecks() { Action act1 = () => NonNullOffspring.AddChildren(null); Action act2 = () => NullOffspring.AddChildren(new [] { 0, 1, 2 }); act1 .Should().Throw <ArgumentNullException>(); act2 .Should().Throw <ArgumentNullException>(); }
public void Mutate_NullChecks() { Action act1 = () => NonNullOffspring.Mutate(10, default(Func <int, TRandom, int>)); Action act2 = () => NullOffspring.Mutate(10, (a, rnd) => a); act1 .Should().Throw <ArgumentNullException>(); act2 .Should().Throw <ArgumentNullException>(); }
public void Recombine_NullChecks() { Action act1 = () => NonNullOffspring.Recombine(10, default(Func <int, int, TRandom, int>)); Action act2 = () => NonNullOffspring.Recombine(10, default(Func <int, int, TRandom, int[]>)); Action act3 = () => NullOffspring.Recombine(10, (a, b, rnd) => a); Action act4 = () => NullOffspring.Recombine(10, (a, b, rnd) => new [] { a, b }); act1 .Should().Throw <ArgumentNullException>(); act2 .Should().Throw <ArgumentNullException>(); act3 .Should().Throw <ArgumentNullException>(); act4 .Should().Throw <ArgumentNullException>(); }