docs: upload screenshots
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 23 KiB |
@ -1,17 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Text;
|
|
||||||
using LD_24.Code;
|
|
||||||
using Bogus;
|
|
||||||
|
|
||||||
namespace LD_24Tests
|
|
||||||
{
|
|
||||||
public class IntLinkedListTests : LinkedListTests<int>
|
|
||||||
{
|
|
||||||
private readonly Faker faker = new Faker("en");
|
|
||||||
|
|
||||||
protected override int CreateItem()
|
|
||||||
{
|
|
||||||
return faker.Random.Number(100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,43 +24,6 @@ namespace LD_24Tests
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "Constructor")]
|
|
||||||
public void CreatingList_Shouldnt_Throw()
|
|
||||||
{
|
|
||||||
Action action = () => new LinkedList<T>();
|
|
||||||
|
|
||||||
action.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Constructor")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void CreateList_From_Other_List(int count)
|
|
||||||
{
|
|
||||||
var list = CreateLoadedList(count);
|
|
||||||
var newList = new LinkedList<T>(list);
|
|
||||||
|
|
||||||
list.Equals(newList).Should().BeTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Add")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Adding_Should_Not_Throw(int count)
|
|
||||||
{
|
|
||||||
LinkedList<T> list = CreateLoadedList(count);
|
|
||||||
Action task = () => list.Add(CreateItem());
|
|
||||||
|
|
||||||
task.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("TestedMethod", "IsEmpty")]
|
[Trait("TestedMethod", "IsEmpty")]
|
||||||
public void New_List_Is_Empty()
|
public void New_List_Is_Empty()
|
||||||
@ -80,19 +43,6 @@ namespace LD_24Tests
|
|||||||
list.IsEmpty().Should().BeFalse();
|
list.IsEmpty().Should().BeFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "IsEmpty")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Is_Empty_Should_Not_Throw(int count)
|
|
||||||
{
|
|
||||||
LinkedList<T> list = CreateLoadedList(count);
|
|
||||||
Action task = () => list.Add(CreateItem());
|
|
||||||
|
|
||||||
task.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "Count")]
|
[Trait("TestedMethod", "Count")]
|
||||||
[InlineData(0)]
|
[InlineData(0)]
|
||||||
@ -105,16 +55,6 @@ namespace LD_24Tests
|
|||||||
list.Count().Should().Be(count);
|
list.Count().Should().Be(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "GetLast")]
|
|
||||||
public void Assert_Last_Element_When_Empty_Doesnt_Throw()
|
|
||||||
{
|
|
||||||
LinkedList<T> list = new LinkedList<T>();
|
|
||||||
Func<T> task = () => list.GetLast();
|
|
||||||
|
|
||||||
task.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "GetLast")]
|
[Trait("TestedMethod", "GetLast")]
|
||||||
[InlineData(0)]
|
[InlineData(0)]
|
||||||
@ -129,28 +69,8 @@ namespace LD_24Tests
|
|||||||
list.GetLast().Should().Be(last);
|
list.GetLast().Should().Be(last);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "GetFirst")]
|
|
||||||
public void Assert_First_Element_When_Empty()
|
|
||||||
{
|
|
||||||
LinkedList<T> list = new LinkedList<T>();
|
|
||||||
|
|
||||||
list.GetFirst().Should().Be(default);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "GetFirst")]
|
|
||||||
public void Assert_First_Element_When_Empty_Doesnt_Throw()
|
|
||||||
{
|
|
||||||
LinkedList<T> list = new LinkedList<T>();
|
|
||||||
Func<T> task = () => list.GetFirst();
|
|
||||||
|
|
||||||
task.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "GetFirst")]
|
[Trait("TestedMethod", "GetFirst")]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
[InlineData(1)]
|
||||||
[InlineData(5)]
|
[InlineData(5)]
|
||||||
public void Assert_First_Element_Value(int count)
|
public void Assert_First_Element_Value(int count)
|
||||||
@ -165,19 +85,6 @@ namespace LD_24Tests
|
|||||||
list.GetFirst().Should().Be(first);
|
list.GetFirst().Should().Be(first);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "RemoveLast")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void RemoveLast_Shouldnt_Throw(int count)
|
|
||||||
{
|
|
||||||
var list = CreateLoadedList(count);
|
|
||||||
Action action = () => list.RemoveLast();
|
|
||||||
|
|
||||||
action.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "RemoveLast")]
|
[Trait("TestedMethod", "RemoveLast")]
|
||||||
[InlineData(1)]
|
[InlineData(1)]
|
||||||
@ -190,40 +97,8 @@ namespace LD_24Tests
|
|||||||
list.RemoveLast().Should().Be(last);
|
list.RemoveLast().Should().Be(last);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "RemoveLast")]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void After_RemoveLast_Length_Should_Decrease(int count)
|
|
||||||
{
|
|
||||||
var list = CreateLoadedList(count);
|
|
||||||
|
|
||||||
list.RemoveLast();
|
|
||||||
list.Count().Should().Be(count-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "RemoveLast")]
|
|
||||||
public void RemoveLast_Does_Nothing_In_Empty_List()
|
|
||||||
{
|
|
||||||
var list = new LinkedList<T>();
|
|
||||||
|
|
||||||
list.RemoveLast();
|
|
||||||
list.Count().Should().Be(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("TestedMethod", "RemoveLast")]
|
|
||||||
public void RemoveLast_Returns_Default_In_Empty_List()
|
|
||||||
{
|
|
||||||
var list = new LinkedList<T>();
|
|
||||||
|
|
||||||
list.RemoveLast().Should().Be(default);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "IEnumerable")]
|
[Trait("TestedMethod", "IEnumerable")]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
[InlineData(1)]
|
||||||
[InlineData(5)]
|
[InlineData(5)]
|
||||||
public void IEnumerable_Is_Implemented_Correctly(int count)
|
public void IEnumerable_Is_Implemented_Correctly(int count)
|
||||||
@ -250,57 +125,6 @@ namespace LD_24Tests
|
|||||||
Assert.True(list.ToString() != list.GetType().ToString());
|
Assert.True(list.ToString() != list.GetType().ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Equals")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Check_If_Lists_Are_Equal(int count)
|
|
||||||
{
|
|
||||||
var list1 = CreateLoadedList(count);
|
|
||||||
var list2 = new LinkedList<T>(list1);
|
|
||||||
|
|
||||||
list1.Equals(list2).Should().BeTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Equals")]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Check_If_Lists_Arent_Equal(int count)
|
|
||||||
{
|
|
||||||
var list1 = CreateLoadedList(count);
|
|
||||||
var list2 = CreateLoadedList(count);
|
|
||||||
|
|
||||||
list1.Equals(list2).Should().BeFalse();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Equals")]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Check_If_Lists_Arent_Equal_By_Size(int count)
|
|
||||||
{
|
|
||||||
var list1 = CreateLoadedList(count);
|
|
||||||
var list2 = new LinkedList<T>(list1);
|
|
||||||
list2.RemoveLast();
|
|
||||||
|
|
||||||
list1.Equals(list2).Should().BeFalse();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[Trait("TestedMethod", "Sort")]
|
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(5)]
|
|
||||||
public void Sort_Shouldnt_Throw(int count)
|
|
||||||
{
|
|
||||||
var list = CreateLoadedList(count);
|
|
||||||
Action action = () => list.Sort();
|
|
||||||
|
|
||||||
action.Should().NotThrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("TestedMethod", "Sort")]
|
[Trait("TestedMethod", "Sort")]
|
||||||
public void Sort_Does_Nothing_On_Empty_List()
|
public void Sort_Does_Nothing_On_Empty_List()
|
||||||
@ -314,7 +138,6 @@ namespace LD_24Tests
|
|||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "Sort")]
|
[Trait("TestedMethod", "Sort")]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
[InlineData(1)]
|
||||||
[InlineData(5)]
|
[InlineData(5)]
|
||||||
public void Items_In_Correct_Order_After_Sort(int count)
|
public void Items_In_Correct_Order_After_Sort(int count)
|
||||||
@ -331,7 +154,6 @@ namespace LD_24Tests
|
|||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[Trait("TestedMethod", "Sort")]
|
[Trait("TestedMethod", "Sort")]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
[InlineData(1)]
|
||||||
[InlineData(5)]
|
[InlineData(5)]
|
||||||
public void Does_Nothing_If_Already_Sorted(int count)
|
public void Does_Nothing_If_Already_Sorted(int count)
|
||||||
|
BIN
L3/LD_24Tests/screenshot1.PNG
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
L3/LD_24Tests/screenshot2.PNG
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
L3/LD_24Tests/screenshot3.PNG
Normal file
After Width: | Height: | Size: 66 KiB |