Conversation
…ge length and writing a test in the case of a disconnected graph
yurii-litvinov
left a comment
There was a problem hiding this comment.
В целом так, но неаккуратно и неэффективно без СНМ
|
|
||
| public class Tests | ||
| { | ||
| IGraph graph = new Graph(); |
There was a problem hiding this comment.
| IGraph graph = new Graph(); | |
| private IGraph graph = new Graph(); |
|
|
||
| using System.Collections.Generic; | ||
|
|
||
| public class Comparator : IComparer<int> |
There was a problem hiding this comment.
Этой штуке тоже нужен комментарий
| /// <summary> | ||
| /// A class for creating custom exceptions | ||
| /// </summary> | ||
| public class DisconnectedGraph : Exception |
There was a problem hiding this comment.
| public class DisconnectedGraph : Exception | |
| public class DisconnectedGraphException : Exception |
Все исключения в .NET именуются с суффиксом Exception
| /// </summary> | ||
| public class DisconnectedGraph : Exception | ||
| { | ||
| public DisconnectedGraph() : base() { } |
There was a problem hiding this comment.
Это можно не писать, оно само сгенерится
| @@ -0,0 +1,44 @@ | |||
| namespace Routers; | |||
|
|
|||
| public interface IGraph | |||
There was a problem hiding this comment.
Интерфейсу тоже нужен комментарий, но я не уверен, что интерфейс нужен вообще
| } | ||
|
|
||
| else |
| { | ||
| ConvertToAnotherDictionary(); | ||
| using StreamWriter writer = new(pathToFile); | ||
| { |
| } | ||
|
|
||
| else |
There was a problem hiding this comment.
| } | |
| else | |
| } | |
| else |
Перед else пустая строка не ставится
| @@ -0,0 +1,35 @@ | |||
| namespace Routers; | |||
|
|
|||
| public class Solution | |||
There was a problem hiding this comment.
А тоже нужен комментарий. А лучше top-level statements
|
|
||
| public class Solution | ||
| { | ||
| static int Main(string[] args) |
| } | ||
| catch (DisconnectedGraph exception) | ||
| { | ||
| Console.WriteLine($"Error: {exception.Message}"); |
There was a problem hiding this comment.
По условию надо было в поток ошибок писать, тут пишется в stdout
…ge length and writing a test in the case of a disconnected graph