1
0
This commit is contained in:
Rokas Puzonas 2022-04-28 01:32:40 +03:00
commit 2e41918039
10 changed files with 21 additions and 196 deletions

View File

@ -14,6 +14,8 @@ on:
- 'report.toml'
- 'L1/LD_24/**'
- 'L2/LD_24/**'
- 'L3/LD_24/**'
- 'L3/LD_24Tests/**'
jobs:
generate-and-upload:
@ -22,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Generate report
uses: RokasPuzonas/ktu-oop-report-generator@v2.0.4
uses: RokasPuzonas/ktu-oop-report-generator@v2.0.8
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
config-filename: ${{ env.CONFIG_FILENAME }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

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

View File

@ -24,43 +24,6 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "IsEmpty")]
public void New_List_Is_Empty()
@ -80,19 +43,6 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "Count")]
[InlineData(0)]
@ -105,16 +55,6 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "GetLast")]
[InlineData(0)]
@ -129,28 +69,8 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "GetFirst")]
[InlineData(0)]
[InlineData(1)]
[InlineData(5)]
public void Assert_First_Element_Value(int count)
@ -165,19 +85,6 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "RemoveLast")]
[InlineData(1)]
@ -190,40 +97,8 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "IEnumerable")]
[InlineData(0)]
[InlineData(1)]
[InlineData(5)]
public void IEnumerable_Is_Implemented_Correctly(int count)
@ -250,57 +125,6 @@ namespace LD_24Tests
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]
[Trait("TestedMethod", "Sort")]
public void Sort_Does_Nothing_On_Empty_List()
@ -314,7 +138,6 @@ namespace LD_24Tests
[Theory]
[Trait("TestedMethod", "Sort")]
[InlineData(0)]
[InlineData(1)]
[InlineData(5)]
public void Items_In_Correct_Order_After_Sort(int count)
@ -331,7 +154,6 @@ namespace LD_24Tests
[Theory]
[Trait("TestedMethod", "Sort")]
[InlineData(0)]
[InlineData(1)]
[InlineData(5)]
public void Does_Nothing_If_Already_Sorted(int count)

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@ -80,6 +80,24 @@ didesnė kaip k eurų (n ir k įvedami klaviatūra).
[[sections]]
title = "Bendrinės klasės ir testavimas (L3)"
project = "L3/LD_24"
tests_project = "L3/LD_24Tests"
interface_scheme = "L3/LD_24/interface-scheme.png"
guide = """
* Atsidaryti tinklalapį
* Pasirenki pradinius duomenų failus
* Įvesti n ir k (n - minimalus vienetų kiekis, k - maksimali vieneto kaina)
* Spausti "Atrinkti" mygtuką
"""
lecturers_comment = """
Dictionary yra palikti kode, kad būtų galima leingviau grupuoti elementus pagal
kažkokį raktą.
"""
tests_screenshots = [
"L3/LD_24Tests/screenshot1.PNG",
"L3/LD_24Tests/screenshot2.PNG",
"L3/LD_24Tests/screenshot3.PNG"
]
problem = """
LD_24. Detalės.