Conversation
yurii-litvinov
left a comment
There was a problem hiding this comment.
В целом всё ок. Давайте факториал надо будет поправить, остальные зачтены
| Assert.Throws<System.NullReferenceException>(factorial -100) | ||
| Assert.AreEqual(factorial -100, None) | ||
| Assert.AreEqual(factorial -1, None) | ||
| Assert.AreEqual(factorial -1024124, None)*) |
There was a problem hiding this comment.
Закомментированный код не нужен, а вот негативные тесты нужны
| Assert.AreEqual(0, fibonacci 0) | ||
| Assert.AreEqual(1, fibonacci 1) | ||
| Assert.AreEqual(5, fibonacci 5) | ||
| Assert.AreEqual(55, fibonacci 10) No newline at end of file |
There was a problem hiding this comment.
И тут надо бы добавить негативности
| @@ -0,0 +1 @@ | |||
| module Program = let [<EntryPoint>] main _ = 0 | |||
There was a problem hiding this comment.
Пустой main указывает на то, что Вы хотели <OutputType>Library</OutputType> в проектном файле
| else if (number = i) then | ||
| Some(acc * number) | ||
| else | ||
| factorialHelper (i+1) (acc*i) |
There was a problem hiding this comment.
Пробелов не хватает, в F# бинарные операции всё так же окружаются пробелами
| else | ||
| factorialHelper (i+1) (acc*i) | ||
|
|
||
| (factorialHelper 1 1).Value No newline at end of file |
There was a problem hiding this comment.
Так упадёт, если number будет меньше 0
There was a problem hiding this comment.
А так он всегда Some возвращает, мог бы просто число возвращать
| else if List.head list = toFind then | ||
| Some(position) | ||
| else | ||
| firstMatchHelper(List.tail list)(position + 1) |
There was a problem hiding this comment.
И тут надо пробелы, так: firstMatchHelper (List.tail list) (position + 1)
| else | ||
| factorialHelper (i+1) (acc*i) | ||
|
|
||
| (factorialHelper 1 1).Value No newline at end of file |
There was a problem hiding this comment.
А так он всегда Some возвращает, мог бы просто число возвращать
No description provided.