Skip to content
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

Заколюкин Степан #227

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
13 commits
Select commit Hold shift + click to select a range
814d450
Написал черновую версию решения задачи
StepanZakolukin Dec 11, 2024
8fc1103
Написал тесты на базовую функциональность, поправил ошибки в решении
StepanZakolukin Dec 11, 2024
83caa66
Отрефакторил код
StepanZakolukin Dec 12, 2024
4beb5c6
Добавил в реализацию обработку циклических ссылок и написал тест на э…
StepanZakolukin Dec 12, 2024
ca5ec7c
Поправил ошибку в тесте на циклические ссылки и опечатку в сериализаторе
StepanZakolukin Dec 12, 2024
cb1fcd1
Добавил сериализацию коллекций и тесты на эту функциональность
StepanZakolukin Dec 12, 2024
acf83af
Отрефакторил теты на сериализацию коллекций
StepanZakolukin Dec 13, 2024
aaffddd
Добавил сообщение в вызов исключения
StepanZakolukin Dec 15, 2024
47601c2
Поправил сериализацию коллекций и тесты
StepanZakolukin Dec 16, 2024
03b57f0
Поправил сериализацию циклических ссылок
StepanZakolukin Dec 16, 2024
ddae456
Отрефакторил метод ToString()
StepanZakolukin Dec 16, 2024
e33ba0f
Применил для вызова исключения более информативную перегрузку
StepanZakolukin Dec 16, 2024
6822458
обернул проверку на финальный тип в метод IsFinalType(Type type)
StepanZakolukin Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Int32[]
Length = 3
LongLength = 3
Rank = 1
SyncRoot = ранее сериализованный объект (стр. 1)
IsReadOnly = False
IsFixedSize = True
IsSynchronized = False
collection items:
1
2
3
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Person
Id = 00000000-0000-0000-0000-000000000000
Name = null
Height = 0
Age = 0
Parent = null
Child = Person
Id = 00000000-0000-0000-0000-000000000000
Name = null
Height = 0
Age = 0
Parent = ранее сериализованный объект (стр. 1)
Child = null
Email = null
Email = null
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Dictionary<List<String>, Int32>
Comparer = ObjectEqualityComparer<List<String>>
Count = 3
Keys = KeyCollection<List<String>, Int32>
Count = 3
collection items:
List<String>
Capacity = 1
Count = 1
collection items:
1
List<String>
Capacity = 1
Count = 1
collection items:
2
List<String>
Capacity = 1
Count = 1
collection items:
3
Values = ValueCollection<List<String>, Int32>
Count = 3
collection items:
1
2
3
collection items:
KeyValuePair<List<String>, Int32>
Key = ранее сериализованный объект (стр. 7)
Value = 1
KeyValuePair<List<String>, Int32>
Key = ранее сериализованный объект (стр. 12)
Value = 2
KeyValuePair<List<String>, Int32>
Key = ранее сериализованный объект (стр. 17)
Value = 3
43 changes: 43 additions & 0 deletions ObjectPrinting.Tests/ObjectPrinting.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<Using Include="NUnit.Framework"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ObjectPrinting\ObjectPrinting.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="8.0.0-alpha.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0-beta.5" />
</ItemGroup>

<ItemGroup>
<None Update="ExpectedResponses\PrintToString_Dictionary_SerializedDictionary.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="ExpectedResponses\PrintToString_Array_SerializedArray.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="ExpectedResponses\PrintToString_CyclicLinks.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;

namespace ObjectPrinting.Solved.Tests
namespace ObjectPrinting.Tests
{
public class Person
{
public Guid Id { get; set; }
public string Name { get; set; }
public double Height { get; set; }
public int Age { get; set; }
public string Email;
public Person Parent { get; set; }
public Person Child { get; set; }
}
}
Loading