Skip to content

Comments

SkipList#10

Open
Andrw-404 wants to merge 12 commits intomainfrom
skipList
Open

SkipList#10
Andrw-404 wants to merge 12 commits intomainfrom
skipList

Conversation

@Andrw-404
Copy link
Owner

No description provided.

Comment on lines +1 to +12
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SkipList.Tests
{
class _
{
}
}

Choose a reason for hiding this comment

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

Что это? :)


var skipList = new SkipList<int>();

skipList.Add(10); No newline at end of file

Choose a reason for hiding this comment

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

Да это вообще было не нужно, сделали бы основной проект типа Library

@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

Choose a reason for hiding this comment

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

Проекты в .NET по традиции именуются с заглавной, как и директории, в которых они находятся.

[Test]
public void CopyTo_CorrectData_ShouldCopyItCorrectly()
{
var testSkipList = new SkipList<int>();

Choose a reason for hiding this comment

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

Можно было три скиплиста (разных типов) вынести в поле, инициализировать их все в SetUp, и не писать их инициализацию в каждом тесте


Assert.That(testSkipList.Count, Is.EqualTo(3));

int[] array = new int[3];

Choose a reason for hiding this comment

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

Suggested change
int[] array = new int[3];
var array = new int[3];

Comment on lines +41 to +44
if (comparer == null)
{
throw new ArgumentNullException(nameof(comparer));
}

Choose a reason for hiding this comment

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

Suggested change
if (comparer == null)
{
throw new ArgumentNullException(nameof(comparer));
}
ArgumentNullException.ThrowIfNull(comparer);

Comment on lines +86 to +87
Node[] update = new Node[MaxLevel];
int[] index = new int[MaxLevel];

Choose a reason for hiding this comment

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

Suggested change
Node[] update = new Node[MaxLevel];
int[] index = new int[MaxLevel];
var update = new Node[MaxLevel];
var index = new int[MaxLevel];

И ниже. Не пишите один тип дважды

{
for (int i = 0; i < MaxLevel; ++i)
{
this.head.Next[i] = null;

Choose a reason for hiding this comment

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

Надо, чтобы компилировалось без предупреждений


if (array.Length - arrayIndex < this.count)
{
throw new ArgumentException();

Choose a reason for hiding this comment

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

Вот тут можно было в Message указать, в чём дело

Comment on lines +234 to +237
public void Insert(int index, T item)
{
throw new NotImplementedException();
}

Choose a reason for hiding this comment

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

Suggested change
public void Insert(int index, T item)
{
throw new NotImplementedException();
}
public void Insert(int index, T item)
=> throw new NotImplementedException();

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