diff --git a/EmployeeManagmentApp.sln b/EmployeeManagmentApp.sln
index 8bb14e6..e1a24f3 100644
--- a/EmployeeManagmentApp.sln
+++ b/EmployeeManagmentApp.sln
@@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmployeeManagmentBusinessLo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmployeeManagmentDataModels", "EmployeeManagmentDataModels\EmployeeManagmentDataModels.csproj", "{C5293211-E924-4CFA-9DE5-69003D8C9F48}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmployeeManagmentDataBaseImplement", "EmployeeManagmentDataBaseImplement\EmployeeManagmentDataBaseImplement.csproj", "{18CB8173-C3E1-4655-A453-A48F20E1DF2E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmployeeManagmentDataBaseImplement", "EmployeeManagmentDataBaseImplement\EmployeeManagmentDataBaseImplement.csproj", "{18CB8173-C3E1-4655-A453-A48F20E1DF2E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmployeeManagmentTests", "EmployeeManagmentTests\EmployeeManagmentTests.csproj", "{6C2F1F37-B54C-493D-82DC-70561145CF49}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -39,6 +41,10 @@ Global
{18CB8173-C3E1-4655-A453-A48F20E1DF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18CB8173-C3E1-4655-A453-A48F20E1DF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18CB8173-C3E1-4655-A453-A48F20E1DF2E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6C2F1F37-B54C-493D-82DC-70561145CF49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6C2F1F37-B54C-493D-82DC-70561145CF49}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6C2F1F37-B54C-493D-82DC-70561145CF49}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6C2F1F37-B54C-493D-82DC-70561145CF49}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/EmployeeManagmentTests/EmployeeManagmentTests.csproj b/EmployeeManagmentTests/EmployeeManagmentTests.csproj
new file mode 100644
index 0000000..d05bbe7
--- /dev/null
+++ b/EmployeeManagmentTests/EmployeeManagmentTests.csproj
@@ -0,0 +1,34 @@
+
+
+
+ net8.0-windows
+ true
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EmployeeManagmentTests/UI/MainWindowTests.cs b/EmployeeManagmentTests/UI/MainWindowTests.cs
new file mode 100644
index 0000000..89f0c0a
--- /dev/null
+++ b/EmployeeManagmentTests/UI/MainWindowTests.cs
@@ -0,0 +1,83 @@
+using FlaUI.Core;
+using FlaUI.Core.AutomationElements;
+using FlaUI.Core.Input;
+using FlaUI.Core.Tools;
+using FlaUI.UIA3;
+using Xunit;
+using System.Linq;
+using System.Threading;
+
+namespace EmployeeManagmentTests.UI
+{
+ [Collection("Sequential")]
+ public class MainWindowTests : IDisposable
+ {
+ private readonly Application _application;
+ private readonly AutomationBase _automation;
+
+ public MainWindowTests()
+ {
+ _automation = new UIA3Automation();
+ _application = Application.Launch("C:\\Users\\kashi\\Desktop\\Univer\\7\\КПО\\Project\\EmployeeManagmentView\\bin\\Debug\\net8.0-windows\\EmployeeManagmentView.exe");
+ }
+
+ [Fact]
+ public void TestOpenEmployeeManagementWindow()
+ {
+ var mainWindow = _application.GetMainWindow(_automation);
+ var employeeButton = mainWindow.FindFirstDescendant(cf => cf.ByText("Работа с сотрудниками")).AsButton();
+
+ // Проверяем, что кнопка доступна и выполняем клик
+ Assert.True(employeeButton.IsEnabled, "Работа с сотрудниками");
+ employeeButton.Invoke();
+
+ // Ждем появления окна "Работа с сотрудниками" с тайм-аутом
+ var employeeManagementWindow = WaitForWindow("Управление сотрудниками");
+ Assert.NotNull(employeeManagementWindow);
+
+ // Проверяем, что окно доступно и готово к взаимодействию
+ Assert.True(employeeManagementWindow.IsEnabled, "Управление сотрудниками");
+ }
+
+ [Fact]
+ public void TestOpenPhysicalPersonManagementWindow()
+ {
+ var mainWindow = _application.GetMainWindow(_automation);
+ var physicalPersonButton = mainWindow.FindFirstDescendant(cf => cf.ByText("Работа с физ. лицами")).AsButton();
+
+ // Проверяем, что кнопка доступна и выполняем клик
+ Assert.True(physicalPersonButton.IsEnabled, "Работа с физ. лицами");
+ physicalPersonButton.Invoke();
+
+ // Ждем появления окна "Работа с физ. лицами" с тайм-аутом
+ var physicalPersonManagementWindow = WaitForWindow("Управление физическими лицами");
+ Assert.NotNull(physicalPersonManagementWindow);
+
+ // Проверяем, что окно доступно и готово к взаимодействию
+ Assert.True(physicalPersonManagementWindow.IsEnabled, "Управление физическими лицами");
+ }
+
+ private Window WaitForWindow(string windowTitle, int timeout = 10000) // Увеличен таймаут
+ {
+ var startTime = DateTime.Now;
+ while ((DateTime.Now - startTime).TotalMilliseconds < timeout)
+ {
+ var window = _application.GetAllTopLevelWindows(_automation)
+ .FirstOrDefault(w => w.Title.Contains(windowTitle));
+ if (window != null && window.IsEnabled)
+ {
+ return window;
+ }
+ Thread.Sleep(200); // Увеличена пауза между попытками
+ }
+ return null; // Если окно не найдено в пределах тайм-аута
+ }
+
+
+ public void Dispose()
+ {
+ _application.Close();
+ _automation.Dispose();
+ }
+ }
+}
diff --git a/EmployeeManagmentTests/Unit/EmployeeLogicTests.cs b/EmployeeManagmentTests/Unit/EmployeeLogicTests.cs
new file mode 100644
index 0000000..3ef487f
--- /dev/null
+++ b/EmployeeManagmentTests/Unit/EmployeeLogicTests.cs
@@ -0,0 +1,138 @@
+using Xunit;
+using Moq;
+using EmployeeManagmentBusinessLogic.BusinessLogic;
+using EmployeeManagmentContracts.ViewModels;
+using EmployeeManagmentContracts.SearchModels;
+using EmployeeManagmentContracts.StoragesContracts;
+using Microsoft.Extensions.Logging;
+
+namespace EmployeeManagmentTests.Unit
+{
+ public class EmployeeLogicTests
+ {
+ private readonly Mock _mockStorage;
+ private readonly Mock> _mockLogger;
+ private readonly EmployeeLogic _logic;
+
+ public EmployeeLogicTests()
+ {
+ _mockStorage = new Mock();
+ _mockLogger = new Mock>();
+ _logic = new EmployeeLogic(_mockLogger.Object, _mockStorage.Object);
+ }
+
+ [Fact]
+ public void GetFullList_ShouldReturnListOfEmployees()
+ {
+ // Arrange
+ var expectedList = new List
+ {
+ new EmployeeViewModel { Id = 1, NameJob = "Developer", StartJob = DateTime.Now.AddYears(-1) },
+ new EmployeeViewModel { Id = 2, NameJob = "Manager", StartJob = DateTime.Now.AddYears(-2) }
+ };
+
+ _mockStorage.Setup(x => x.GetFullList()).Returns(expectedList);
+
+ // Act
+ var result = _logic.GetFullList();
+
+ // Assert
+ Assert.Equal(expectedList.Count, result.Count);
+ Assert.Equal(expectedList[0].NameJob, result[0].NameJob);
+ }
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnFilteredResults()
+ {
+ // Arrange
+ var model = new EmployeeSearchModel { NameJob = "Developer" };
+ var expectedList = new List
+ {
+ new EmployeeViewModel { Id = 1, NameJob = "Developer", StartJob = DateTime.Now.AddYears(-1) }
+ };
+
+ _mockStorage.Setup(x => x.GetFilteredList(model)).Returns(expectedList);
+
+ // Act
+ var result = _logic.GetFilteredList(model);
+
+ // Assert
+ Assert.Single(result);
+ Assert.Equal("Developer", result[0].NameJob);
+ }
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnEmptyList_IfNoMatch()
+ {
+ // Arrange
+ var model = new EmployeeSearchModel { NameJob = "Unknown" };
+ _mockStorage.Setup(x => x.GetFilteredList(model)).Returns(new List());
+
+ // Act
+ var result = _logic.GetFilteredList(model);
+
+ // Assert
+ Assert.Empty(result);
+ }
+
+ [Fact]
+ public void Insert_ShouldThrowException_IfNameJobIsEmpty()
+ {
+ // Arrange
+ var invalidModel = new EmployeeViewModel { NameJob = "" };
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Insert(invalidModel));
+ }
+
+ [Fact]
+ public void Insert_ShouldCallStorageInsert_IfDataIsValid()
+ {
+ // Arrange
+ var validModel = new EmployeeViewModel { NameJob = "Developer", StartJob = DateTime.Now };
+
+ // Act
+ _logic.Insert(validModel);
+
+ // Assert
+ _mockStorage.Verify(x => x.Insert(validModel), Times.Once);
+ }
+
+ [Fact]
+ public void Update_ShouldThrowException_IfElementNotFound()
+ {
+ // Arrange
+ var model = new EmployeeViewModel { Id = 1, NameJob = "Developer" };
+ _mockStorage.Setup(x => x.GetElement(model.Id)).Returns((EmployeeViewModel?)null);
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Update(model));
+ }
+
+ [Fact]
+ public void Delete_ShouldThrowException_IfElementNotFound()
+ {
+ // Arrange
+ var id = 1;
+ _mockStorage.Setup(x => x.GetElement(id)).Returns((EmployeeViewModel?)null);
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Delete(id));
+ }
+
+ [Fact]
+ public void Delete_ShouldCallStorageDelete_IfElementExists()
+ {
+ // Arrange
+ var id = 1;
+ var model = new EmployeeViewModel { Id = id };
+ _mockStorage.Setup(x => x.GetElement(id)).Returns(model);
+
+ // Act
+ _logic.Delete(id);
+
+ // Assert
+ _mockStorage.Verify(x => x.Delete(id), Times.Once);
+ }
+ }
+}
diff --git a/EmployeeManagmentTests/Unit/PhisicalPersonLogicTests.cs b/EmployeeManagmentTests/Unit/PhisicalPersonLogicTests.cs
new file mode 100644
index 0000000..97005eb
--- /dev/null
+++ b/EmployeeManagmentTests/Unit/PhisicalPersonLogicTests.cs
@@ -0,0 +1,139 @@
+using Xunit;
+using Moq;
+using EmployeeManagmentBusinessLogic.BusinessLogic;
+using EmployeeManagmentContracts.ViewModels;
+using EmployeeManagmentContracts.SearchModels;
+using EmployeeManagmentContracts.StoragesContracts;
+using Microsoft.Extensions.Logging;
+
+namespace EmployeeManagmentTests.Unit
+{
+ public class PhisicalPersonLogicTests
+ {
+ private readonly Mock _mockStorage;
+ private readonly Mock> _mockLogger;
+ private readonly PhisicalPersonLogic _logic;
+
+ public PhisicalPersonLogicTests()
+ {
+ _mockStorage = new Mock();
+ _mockLogger = new Mock>();
+ _logic = new PhisicalPersonLogic(_mockLogger.Object, _mockStorage.Object);
+ }
+
+ [Fact]
+ public void GetFullList_ShouldReturnListOfPhisicalPersons()
+ {
+ // Arrange
+ var expectedList = new List
+ {
+ new PhisicalPersonViewModel { Id = 1, Name = "John", Surname = "Doe" },
+ new PhisicalPersonViewModel { Id = 2, Name = "Jane", Surname = "Smith" }
+ };
+
+ _mockStorage.Setup(x => x.GetFullList()).Returns(expectedList);
+
+ // Act
+ var result = _logic.GetFullList();
+
+ // Assert
+ Assert.Equal(expectedList.Count, result.Count);
+ Assert.Equal(expectedList[0].Name, result[0].Name);
+ }
+
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnFilteredResults()
+ {
+ // Arrange
+ var model = new PhisicalPersonSearchModel { Surname = "Doe" };
+ var expectedList = new List
+ {
+ new PhisicalPersonViewModel { Id = 1, Name = "John", Surname = "Doe" }
+ };
+
+ _mockStorage.Setup(x => x.GetFilteredList(model)).Returns(expectedList);
+
+ // Act
+ var result = _logic.GetFilteredList(model);
+
+ // Assert
+ Assert.Single(result);
+ Assert.Equal("Doe", result[0].Surname);
+ }
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnEmptyList_IfNoMatch()
+ {
+ // Arrange
+ var model = new PhisicalPersonSearchModel { Surname = "Unknown" };
+ _mockStorage.Setup(x => x.GetFilteredList(model)).Returns(new List());
+
+ // Act
+ var result = _logic.GetFilteredList(model);
+
+ // Assert
+ Assert.Empty(result);
+ }
+
+ [Fact]
+ public void Insert_ShouldThrowException_IfNameOrSurnameIsEmpty()
+ {
+ // Arrange
+ var invalidModel = new PhisicalPersonViewModel { Name = "", Surname = "" };
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Insert(invalidModel));
+ }
+
+ [Fact]
+ public void Insert_ShouldCallStorageInsert_IfDataIsValid()
+ {
+ // Arrange
+ var validModel = new PhisicalPersonViewModel { Name = "John", Surname = "Doe" };
+
+ // Act
+ _logic.Insert(validModel);
+
+ // Assert
+ _mockStorage.Verify(x => x.Insert(validModel), Times.Once);
+ }
+
+ [Fact]
+ public void Update_ShouldThrowException_IfElementNotFound()
+ {
+ // Arrange
+ var model = new PhisicalPersonViewModel { Id = 1, Name = "John", Surname = "Doe" };
+ _mockStorage.Setup(x => x.GetElement(model.Id)).Returns((PhisicalPersonViewModel?)null);
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Update(model));
+ }
+
+ [Fact]
+ public void Delete_ShouldThrowException_IfElementNotFound()
+ {
+ // Arrange
+ var id = 1;
+ _mockStorage.Setup(x => x.GetElement(id)).Returns((PhisicalPersonViewModel?)null);
+
+ // Act & Assert
+ Assert.Throws(() => _logic.Delete(id));
+ }
+
+ [Fact]
+ public void Delete_ShouldCallStorageDelete_IfElementExists()
+ {
+ // Arrange
+ var id = 1;
+ var model = new PhisicalPersonViewModel { Id = id };
+ _mockStorage.Setup(x => x.GetElement(id)).Returns(model);
+
+ // Act
+ _logic.Delete(id);
+
+ // Assert
+ _mockStorage.Verify(x => x.Delete(id), Times.Once);
+ }
+ }
+}
diff --git a/EmployeeManagmentTests/Unit/SalaryLogicTests.cs b/EmployeeManagmentTests/Unit/SalaryLogicTests.cs
new file mode 100644
index 0000000..39c75df
--- /dev/null
+++ b/EmployeeManagmentTests/Unit/SalaryLogicTests.cs
@@ -0,0 +1,142 @@
+using EmployeeManagmentBusinessLogic.BusinessLogic;
+using EmployeeManagmentContracts.SearchModels;
+using EmployeeManagmentContracts.ViewModels;
+using EmployeeManagmentDataBaseImplement.Implements;
+using Microsoft.Extensions.Logging;
+using Moq;
+using Xunit;
+
+namespace EmployeeManagmentTests.Unit
+{
+ public class SalaryLogicTests
+ {
+ private readonly Mock> _loggerMock;
+ private readonly SalaryStorage _salaryStorage;
+ private readonly SalaryLogic _salaryLogic;
+
+ public SalaryLogicTests()
+ {
+ _loggerMock = new Mock>();
+ _salaryStorage = new SalaryStorage();
+ _salaryLogic = new SalaryLogic(_loggerMock.Object, _salaryStorage);
+ }
+
+ [Fact]
+ public void GetFullList_ShouldReturnAllSalaries()
+ {
+ // Arrange
+ var expectedCount = _salaryStorage.GetFullList().Count;
+
+ // Act
+ var result = _salaryLogic.GetFullList();
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.Equal(expectedCount, result.Count);
+ }
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnFilteredSalaries()
+ {
+ // Arrange
+ var filter = new SalarySearchModel
+ {
+ Date = DateTime.UtcNow.AddMonths(-1) // Используйте UTC
+ };
+
+ // Act
+ var result = _salaryLogic.GetFilteredList(filter);
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.All(result, salary => Assert.True(salary.Date >= filter.Date));
+ }
+
+
+ [Fact]
+ public void GetElement_ShouldReturnCorrectSalary()
+ {
+ // Arrange
+ var salaries = _salaryLogic.GetFullList();
+ if (salaries.Count == 0)
+ {
+ Assert.True(false, "No salaries available for testing.");
+ }
+
+ var salaryId = salaries.First().Id;
+
+ // Act
+ var result = _salaryLogic.GetElement(salaryId);
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.Equal(salaryId, result.Id);
+ }
+
+ [Fact]
+ public void Insert_ShouldAddSalary()
+ {
+ // Arrange
+ var newSalary = new SalaryViewModel
+ {
+ CountHours = 40,
+ PriceHour = 15,
+ Premium = 200,
+ Date = DateTime.UtcNow, // Используем UTC для даты
+ Passed = false,
+ EmployeeId = 1
+ };
+
+ var initialCount = _salaryLogic.GetFullList().Count;
+
+ // Act
+ _salaryLogic.Insert(newSalary);
+ var updatedCount = _salaryLogic.GetFullList().Count;
+
+ // Assert
+ Assert.Equal(initialCount + 1, updatedCount);
+ }
+
+
+ [Fact]
+ public void Update_ShouldModifySalary()
+ {
+ // Arrange
+ var salary = _salaryLogic.GetFullList().FirstOrDefault();
+ if (salary == null)
+ {
+ Assert.True(false, "No salaries available for testing.");
+ }
+
+ salary.PriceHour += 5;
+
+ // Act
+ _salaryLogic.Update(salary);
+ var updatedSalary = _salaryLogic.GetElement(salary.Id);
+
+ // Assert
+ Assert.NotNull(updatedSalary);
+ Assert.Equal(salary.PriceHour, updatedSalary.PriceHour);
+ }
+
+ [Fact]
+ public void Delete_ShouldRemoveSalary()
+ {
+ // Arrange
+ var salary = _salaryLogic.GetFullList().LastOrDefault();
+ if (salary == null)
+ {
+ Assert.True(false, "No salaries available for testing.");
+ }
+
+ var initialCount = _salaryLogic.GetFullList().Count;
+
+ // Act
+ _salaryLogic.Delete(salary.Id);
+ var updatedCount = _salaryLogic.GetFullList().Count;
+
+ // Assert
+ Assert.Equal(initialCount - 1, updatedCount);
+ }
+ }
+}
diff --git a/EmployeeManagmentTests/Unit/VacationLogicTests.cs b/EmployeeManagmentTests/Unit/VacationLogicTests.cs
new file mode 100644
index 0000000..6e6ddd2
--- /dev/null
+++ b/EmployeeManagmentTests/Unit/VacationLogicTests.cs
@@ -0,0 +1,144 @@
+using EmployeeManagmentBusinessLogic.BusinessLogic;
+using EmployeeManagmentContracts.SearchModels;
+using EmployeeManagmentContracts.ViewModels;
+using EmployeeManagmentDataBaseImplement.Implements;
+using Microsoft.Extensions.Logging;
+using Moq;
+using Xunit;
+
+namespace EmployeeManagmentTests.Unit
+{
+ public class VacationLogicTests
+ {
+ private readonly Mock> _loggerMock;
+ private readonly VacationStorage _vacationStorage;
+ private readonly VacationLogic _vacationLogic;
+
+ public VacationLogicTests()
+ {
+ _loggerMock = new Mock>();
+ _vacationStorage = new VacationStorage();
+ _vacationLogic = new VacationLogic(_loggerMock.Object, _vacationStorage);
+ }
+
+ [Fact]
+ public void GetFullList_ShouldReturnAllVacations()
+ {
+ // Arrange
+ var expectedCount = _vacationStorage.GetFullList().Count;
+
+ // Act
+ var result = _vacationLogic.GetFullList();
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.Equal(expectedCount, result.Count);
+ }
+
+ [Fact]
+ public void GetFilteredList_ShouldReturnFilteredVacations()
+ {
+ // Arrange
+ var filter = new VacationSearchModel
+ {
+ StartData = DateTime.UtcNow.AddMonths(-1),
+ EndData = DateTime.UtcNow
+ };
+
+ // Act
+ var result = _vacationLogic.GetFilteredList(filter);
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.All(result, vacation =>
+ Assert.True(vacation.StartData >= filter.StartData && vacation.EndData <= filter.EndData)
+ );
+ }
+
+ [Fact]
+ public void GetElement_ShouldReturnCorrectVacation()
+ {
+ // Arrange
+ var vacations = _vacationLogic.GetFullList();
+ if (vacations.Count == 0)
+ {
+ Assert.True(false, "No vacations available for testing.");
+ }
+
+ var vacationId = vacations.First().Id;
+
+ // Act
+ var result = _vacationLogic.GetElement(vacationId);
+
+ // Assert
+ Assert.NotNull(result);
+ Assert.Equal(vacationId, result.Id);
+ }
+
+ [Fact]
+ public void Insert_ShouldAddVacation()
+ {
+ // Arrange
+ var newVacation = new VacationViewModel
+ {
+ StartData = DateTime.UtcNow.AddDays(1).ToUniversalTime(), // Преобразование в UTC
+ EndData = DateTime.UtcNow.AddDays(10).ToUniversalTime(), // Преобразование в UTC
+ Passed = false,
+ EmployeeId = 1 // ID существующего сотрудника
+ };
+
+ var initialCount = _vacationLogic.GetFullList().Count;
+
+ // Act
+ _vacationLogic.Insert(newVacation);
+ var updatedCount = _vacationLogic.GetFullList().Count;
+
+ // Assert
+ Assert.Equal(initialCount + 1, updatedCount);
+ }
+
+ [Fact]
+ public void Update_ShouldModifyVacation()
+ {
+ // Arrange
+ var vacation = _vacationLogic.GetFullList().FirstOrDefault();
+ if (vacation == null)
+ {
+ Assert.True(false, "No vacations available for testing.");
+ }
+
+ vacation.EndData = DateTime.UtcNow.AddDays(20).ToUniversalTime(); // Преобразование в UTC
+
+ // Act
+ _vacationLogic.Update(vacation);
+ var updatedVacation = _vacationLogic.GetElement(vacation.Id);
+
+ // Assert
+ Assert.NotNull(updatedVacation);
+
+ // Сравниваем с учетом допустимой погрешности в миллисекундах
+ Assert.Equal(vacation.EndData, updatedVacation.EndData, TimeSpan.FromMilliseconds(1));
+ }
+
+
+ [Fact]
+ public void Delete_ShouldRemoveVacation()
+ {
+ // Arrange
+ var vacation = _vacationLogic.GetFullList().LastOrDefault();
+ if (vacation == null)
+ {
+ Assert.True(false, "No vacations available for testing.");
+ }
+
+ var initialCount = _vacationLogic.GetFullList().Count;
+
+ // Act
+ _vacationLogic.Delete(vacation.Id);
+ var updatedCount = _vacationLogic.GetFullList().Count;
+
+ // Assert
+ Assert.Equal(initialCount - 1, updatedCount);
+ }
+ }
+}
diff --git a/EmployeeManagmentView/Employee/EmployeeManagementWindow.xaml b/EmployeeManagmentView/Employee/EmployeeManagementWindow.xaml
index 30816e3..904b95c 100644
--- a/EmployeeManagmentView/Employee/EmployeeManagementWindow.xaml
+++ b/EmployeeManagmentView/Employee/EmployeeManagementWindow.xaml
@@ -1,7 +1,7 @@