Skip to content

Routers#12

Open
MinyazevR wants to merge 5 commits intomainfrom
Routers
Open

Routers#12
MinyazevR wants to merge 5 commits intomainfrom
Routers

Conversation

@MinyazevR
Copy link
Copy Markdown
Owner

…ge length and writing a test in the case of a disconnected graph

Copy link
Copy Markdown

@yurii-litvinov yurii-litvinov left a 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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IGraph graph = new Graph();
private IGraph graph = new Graph();


using System.Collections.Generic;

public class Comparator : IComparer<int>
Copy link
Copy Markdown

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class DisconnectedGraph : Exception
public class DisconnectedGraphException : Exception

Все исключения в .NET именуются с суффиксом Exception

/// </summary>
public class DisconnectedGraph : Exception
{
public DisconnectedGraph() : base() { }
Copy link
Copy Markdown

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интерфейсу тоже нужен комментарий, но я не уверен, что интерфейс нужен вообще

Comment on lines +233 to +235
}

else
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else
}
else

{
ConvertToAnotherDictionary();
using StreamWriter writer = new(pathToFile);
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут фигурные скобки не нужны

Comment on lines +274 to +276
}

else
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else
}
else

Перед else пустая строка не ставится

@@ -0,0 +1,35 @@
namespace Routers;

public class Solution
Copy link
Copy Markdown

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)
Copy link
Copy Markdown

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}");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По условию надо было в поток ошибок писать, тут пишется в stdout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants