public void ShouldIgnoreMutatorWithOptions() { var target = new IgnoreMutationsInput { SuppliedInput = new string[] { "linq.Sum", "string.empty", "logical.equal" } }; var result = target.Validate(); result.ShouldBeEmpty(); }
public void ShouldValidateExcludedMutation() { var target = new IgnoreMutationsInput { SuppliedInput = new[] { "gibberish" } }; var ex = Should.Throw <InputException>(() => target.Validate()); ex.Message.ShouldBe($"Invalid excluded mutation (gibberish). The excluded mutations options are [Statement, Arithmetic, Block, Equality, Boolean, Logical, Assignment, Unary, Update, Checked, Linq, String, Bitwise, Initializer, Regex]"); }
public void ShouldHaveDefault() { var target = new IgnoreMutationsInput { SuppliedInput = new string[] { } }; var result = target.Validate(); result.ShouldBeEmpty(); }
public void ShouldIgnoreStatementMutator() { var target = new IgnoreMutationsInput { SuppliedInput = new[] { "statement" } }; var mutators = target.Validate(); mutators.ShouldHaveSingleItem().ShouldBe(Mutator.Statement); }
public void ShouldReturnMultipleMutators() { var target = new IgnoreMutationsInput { SuppliedInput = new[] { Mutator.String.ToString(), Mutator.Logical.ToString() } }; var result = target.Validate(); result.Count().ShouldBe(2); result.First().ShouldBe(Mutator.String); result.Last().ShouldBe(Mutator.Logical); }