-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routers #12
base: main
Are you sure you want to change the base?
Conversation
…ge length and writing a test in the case of a disconnected graph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В целом так, но неаккуратно и неэффективно без СНМ
|
||
public class Tests | ||
{ | ||
IGraph graph = new Graph(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этой штуке тоже нужен комментарий
/// <summary> | ||
/// A class for creating custom exceptions | ||
/// </summary> | ||
public class DisconnectedGraph : Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это можно не писать, оно само сгенерится
@@ -0,0 +1,44 @@ | |||
namespace Routers; | |||
|
|||
public interface IGraph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Интерфейсу тоже нужен комментарий, но я не уверен, что интерфейс нужен вообще
} | ||
|
||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else | |
} | |
else |
{ | ||
ConvertToAnotherDictionary(); | ||
using StreamWriter writer = new(pathToFile); | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут фигурные скобки не нужны
} | ||
|
||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else | |
} | |
else |
Перед else пустая строка не ставится
@@ -0,0 +1,35 @@ | |||
namespace Routers; | |||
|
|||
public class Solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А тоже нужен комментарий. А лучше top-level statements
|
||
public class Solution | ||
{ | ||
static int Main(string[] args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
} | ||
catch (DisconnectedGraph exception) | ||
{ | ||
Console.WriteLine($"Error: {exception.Message}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По условию надо было в поток ошибок писать, тут пишется в stdout
…ge length and writing a test in the case of a disconnected graph