Skip to content

Conversation

@MinyazevR
Copy link
Owner

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

Copy link

@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();

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>

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

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() { }

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

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

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);
{

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

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

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)

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

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