public void ShouldNotMutateEmptyInitializer() { var objectCreationExpression = SyntaxFactory.ParseExpression("new List<int> { }") as ObjectCreationExpressionSyntax; var target = new ObjectCreationMutator(); var result = target.ApplyMutations(objectCreationExpression); result.ShouldBeEmpty(); }
public void ShouldRemoveValuesFromCollectionInitializer(string initializer) { var objectCreationExpression = SyntaxFactory.ParseExpression(initializer) as ObjectCreationExpressionSyntax; var target = new ObjectCreationMutator(); var result = target.ApplyMutations(objectCreationExpression); var mutation = result.ShouldHaveSingleItem(); var replacement = mutation.ReplacementNode.ShouldBeOfType <ObjectCreationExpressionSyntax>(); replacement.Initializer.Expressions.ShouldBeEmpty(); }
public void ShouldBeMutationLevelStandard() { var target = new ObjectCreationMutator(); target.MutationLevel.ShouldBe(MutationLevel.Standard); }