Conversation
| <PackageReference Include="NUnit" Version="4.2.2" /> | ||
| <PackageReference Include="NUnit.Analyzers" Version="4.4.0" /> | ||
| <PackageReference Include="NUnit3TestAdapter" Version="4.6.0" /> | ||
| <PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> |
There was a problem hiding this comment.
StyleCop используйте версии 1.2-beta. 1.1 не знает современного C# и из-за этого генерирует кучу ложных предупреждений
| public class Tests | ||
| { | ||
| [Test] | ||
| public void Dequeu_IntegerValue_ShouldReturnCorrectValues() |
|
|
||
| #pragma warning disable SA1600 | ||
|
|
||
| namespace PriorityQueue.Tests |
There was a problem hiding this comment.
Используйте file-scoped namespaces, фигурные скобки тут ни к чему
| testQueue.Enqueue(32, 3); | ||
| testQueue.Enqueue(55, 2); | ||
|
|
||
| Assert.That(testQueue.Dequeue, Is.EqualTo(13)); |
There was a problem hiding this comment.
Dequeue свойство, что ли? Это архитектурно неправильно, ведь оно меняет состояние объекта при чтении. Это метод должен был быть.
| public void Dequeu_EmptyQueue_ShouldThrowAnException() | ||
| { | ||
| var testQueue = new Queue<bool>(); | ||
| Assert.Throws<InvalidDataException>(() => testQueue.Dequeue()); |
There was a problem hiding this comment.
Я бы ожидал InvalidOperationException тут.
| Assert.Throws<InvalidDataException>(() => testQueue.Dequeue()); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Нет теста на одинаковые приоритеты
| @@ -0,0 +1,7 @@ | |||
| // <copyright file="Program.cs" company="PlaceholderCompany"> | |||
| // Copyright (c) PlaceholderCompany. All rights reserved. | |||
There was a problem hiding this comment.
PlaceholderCompany не очень, настроили бы себе шапку с лицензией более содержательно
|
|
||
| using PriorityQueue; | ||
|
|
||
| Console.WriteLine("Hello world"); No newline at end of file |
There was a problem hiding this comment.
Это не нужно, выставили бы OutputType в Library в свойствах проекта
| /// Priority queue element. | ||
| /// </summary> | ||
| /// <typeparam name="T">Type of stored value.</typeparam> | ||
| public struct QueueNode<T> |
There was a problem hiding this comment.
Он мог бы быть record-ом и писаться в одну строчку :) И вложенным в Queue, внешнему миру про него знать совершенно не нужно
| /// The class that implements the queue. | ||
| /// </summary> | ||
| /// <typeparam name="T">The type of the element value.</typeparam> | ||
| public class Queue<T> |
There was a problem hiding this comment.
Как-то отразили бы в названии, что очередь с приоритетами, а не простая
No description provided.