Skip to content

Inappropriate name of function in an example (F# unittesting) - sumOfSquares #4902

Closed
@jurajplavcan

Description

@jurajplavcan

Inappropriate name of function in an example - sumOfSquares

https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-dotnet-test

In the example unit tests are written for a MyMath.sumOfSquares function in a TDD fashion. As I read through the document the name of the function appeared rather inaccurate.

Possible fix

Based on the last test:

let ``SquaresOfOdds works`` () =
    let expected = [1; 9; 25; 49; 81]
    let actual = MyMath.sumOfSquares [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
    Assert.Equal(expected, actual)

I would suggest calling the function MyMath.squaresOfOdds instead of MyMath.sumOfSquares.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions