Skip to content

Conversation

@derasoft004
Copy link

ФИО: Зюзин Егор
Номер группы: 6413
Номер лабораторной: 3
Номер варианта: 67
Краткое описание предметной области: Поликлиника
Краткое описание добавленных фич: «ORM» - Реализовал объектно-реляционную модель. Подключился к базе данных PostgreSQL, проект полностью освободился от inmemory инфраструктуры.

derasoft004 and others added 30 commits October 28, 2025 10:45
commit 17: add PolyclinicTests.yml - action for my tests
@github-actions github-actions bot added In progress Код в процессе проверки Lab 3 Лабораторная №3. ORM labels Dec 21, 2025
Copy link

@DmitryKrakhmalev DmitryKrakhmalev left a comment

Choose a reason for hiding this comment

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

  1. Есть замечания. Перед тем как направлять свою работу на проверку, лучше проанализировать солюшен на наличие ошибок.
  2. Не вижу Aspire проекта;
  3. Нужен cleanup и переименовка некоторых папок;
  4. У вас тесты падают с ошибкой.
image

{
private readonly Mock<IRepository<Appointment, int>> _mockAppointmentRepository;
private readonly Mock<IRepository<Patient, int>> _mockPatientRepository;
private readonly IAnalyticsService _analyticsService;

Choose a reason for hiding this comment

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

Если вы в конструкторе создаете AnalyticsService то и тут тип лучше прописать AnalyticsService вместо интерфейса.

public class AnalyticsServiceTests
{
private readonly Mock<IRepository<Appointment, int>> _mockAppointmentRepository;
private readonly Mock<IRepository<Patient, int>> _mockPatientRepository;

Choose a reason for hiding this comment

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

Не используется, можно убрать.

using Polyclinic.Contracts.Dto;
using Xunit;

namespace Polyclinic.Tests.API;

Choose a reason for hiding this comment

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

Папку API переименовать в PascalCase. Не забыть про неймспейсы.

using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Polyclinic.Domain.Subjects;

namespace Polyclinic.Infrastructure.PostgreSQL.Configurations;

Choose a reason for hiding this comment

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

Папку PostgreSQL переименовать в PascalCase. Не забыть про неймспейсы.

@@ -0,0 +1,185 @@
using System;

Choose a reason for hiding this comment

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

Добавить первой строкой // <auto-generated />

/// </summary>
public List<Patient> ReadAll()
{
return context.Patients.ToList();

Choose a reason for hiding this comment

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

Упростить


public List<Specialization> ReadAll()
{
return context.Specializations.ToList();

Choose a reason for hiding this comment

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

и тут

[Fact]
public void GetPatientsByDoctor_NoPatients_ReturnsNotFound()
{
_mockAnalyticsService.Setup(service => service.GetPatientsByDoctor(999)).Returns(new List<PatientDto>());

Choose a reason for hiding this comment

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

Suggested change
_mockAnalyticsService.Setup(service => service.GetPatientsByDoctor(999)).Returns(new List<PatientDto>());
_mockAnalyticsService.Setup(service => service.GetPatientsByDoctor(999)).Returns([]);


var patients = analyticsService.GetPatientsByDoctor(id);

if (patients == null || !patients.Any())

Choose a reason for hiding this comment

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

Suggested change
if (patients == null || !patients.Any())
if (patients == null || patients.Count == 0)


public class PolyclinicDbContext : DbContext
{
public PolyclinicDbContext(DbContextOptions<PolyclinicDbContext> options)

Choose a reason for hiding this comment

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

primary constructor

Copy link

@DmitryKrakhmalev DmitryKrakhmalev left a comment

Choose a reason for hiding this comment

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

Обратите внимание на замечания выше. Я не увидел чтобы они были устранены. Также добавил новые замечания.
Вам необходимо устранить все замечание, а главное:

  • Использовать Aspire;
  • При работе с базой данных необходимо использовать асинхронные методы. Переделайте репозитории.

/// </summary>
public int Create(Patient entity)
{
context.Patients.Add(entity);

Choose a reason for hiding this comment

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

Работать нужно с асинхронными методами. Переделать все методы репозиториев на асинхронные

private readonly Mock<IRepository<Patient, int>> _mockPatientRepository;
private readonly Mock<IRepository<Appointment, int>> _mockAppointmentRepository;
private readonly PolyclinicDbContext _dbContext;
private readonly IPatientService _patientService;

Choose a reason for hiding this comment

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

Замечание не устранено.

@DmitryKrakhmalev
Copy link

Я не вижу запроса не Review. 4 PR буду принимать только когда по этому будут устранены все замечания.

Copy link

@DmitryKrakhmalev DmitryKrakhmalev left a comment

Choose a reason for hiding this comment

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

Работу засчитываю. Так как некоторые замечания не были устранены (главное из них использование асинхронных методов), оценка -1 балл.

@DmitryKrakhmalev DmitryKrakhmalev added Approved Лабораторная зачтена and removed In progress Код в процессе проверки labels Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Лабораторная зачтена Lab 3 Лабораторная №3. ORM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants