예제 #1
0
        public void ShouldIgnoreMutatorWithOptions()
        {
            var target = new IgnoreMutationsInput {
                SuppliedInput = new string[] { "linq.Sum", "string.empty", "logical.equal" }
            };

            var result = target.Validate();

            result.ShouldBeEmpty();
        }
예제 #2
0
        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]");
        }
예제 #3
0
        public void ShouldHaveDefault()
        {
            var target = new IgnoreMutationsInput {
                SuppliedInput = new string[] { }
            };

            var result = target.Validate();

            result.ShouldBeEmpty();
        }
예제 #4
0
        public void ShouldIgnoreStatementMutator()
        {
            var target = new IgnoreMutationsInput
            {
                SuppliedInput = new[] { "statement" }
            };

            var mutators = target.Validate();

            mutators.ShouldHaveSingleItem().ShouldBe(Mutator.Statement);
        }
예제 #5
0
        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);
        }