public static void Update(ExpressionBodiedDataOccurence occurrence, uint expectedArrowSingleLineOccurences, uint expectedArrowMultiLineOccurences, uint expectedBlockOccurences) { var data = new ExpressionBodiedData(); data = data.Update(occurrence); Assert.That(data.TotalOccurences, Is.EqualTo(1u), nameof(data.TotalOccurences)); Assert.That(data.ArrowSingleLineOccurences, Is.EqualTo(expectedArrowSingleLineOccurences), nameof(data.ArrowSingleLineOccurences)); Assert.That(data.ArrowMultiLineOccurences, Is.EqualTo(expectedArrowMultiLineOccurences), nameof(data.ArrowMultiLineOccurences)); Assert.That(data.BlockOccurences, Is.EqualTo(expectedBlockOccurences), nameof(data.BlockOccurences)); }
public ExpressionBodiedData Update(ExpressionBodiedDataOccurence occurence) => new ExpressionBodiedData(this.TotalOccurences + 1, occurence == ExpressionBodiedDataOccurence.ArrowSingleLine ? this.ArrowSingleLineOccurences + 1 : this.ArrowSingleLineOccurences, occurence == ExpressionBodiedDataOccurence.ArrowMultiLine ? this.ArrowMultiLineOccurences + 1 : this.ArrowMultiLineOccurences, occurence == ExpressionBodiedDataOccurence.Block ? this.BlockOccurences + 1 : this.BlockOccurences);