-
Notifications
You must be signed in to change notification settings - Fork 0
queue #12
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
base: master
Are you sure you want to change the base?
queue #12
Conversation
| Console.WriteLine(queue.Dequeue()); | ||
| Console.WriteLine(queue.Dequeue()); | ||
| Console.WriteLine(queue.Dequeue()); | ||
| Console.WriteLine(queue.Dequeue()); No newline at end of file |
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.
Это не нужно. Собирайте библиотеку и проверяйте работоспособность тестами
| using System.Security; | ||
|
|
||
| namespace DataStructures; |
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.
- Не хватает заголовка с информацией о лицензии
- namespace обычно пишут первой содержательной строкой в файле, сразу после лицензии, а using-и уже внутри
|
|
||
| namespace DataStructures; | ||
|
|
||
| public class Queue<T>(int startCapacity = 1) |
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 Queue<T>(int startCapacity = 1) | ||
| { | ||
| private Tuple<T, int>[] heap = new Tuple<T, int>[startCapacity]; | ||
| public int CurrentCapacity = startCapacity; |
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-полей быть не должно вообще
|
|
||
| public class Queue<T>(int startCapacity = 1) | ||
| { | ||
| private Tuple<T, int>[] heap = new Tuple<T, int>[startCapacity]; |
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.
Tuple в современном C# не нужны, есть кортежи
| namespace DataStructures; | ||
|
|
||
| [System.Serializable] | ||
| public class QueueIsEmtpyException : System.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 QueueIsEmtpyException : System.Exception | |
| public class QueueIsEmptyException : System.Exception |
| { | ||
| Assert.That(queue.Dequeue, Is.EqualTo(answers[i])); | ||
| } | ||
| } |
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.
Тестов негусто. В частности, интересно поведение при одинаковых приоритетах
| { | ||
| if (Empty()) | ||
| { | ||
| throw new QueueIsEmtpyException("Queue is empty"); |
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.
Делать эту проверку в Enqueue, очевидно, неправильно :) Из-за неё тесты не проходят.
No description provided.