From 3978ab32871945d54a0486bd11d4fb267b8aebeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D1=81=D0=B5=D0=BD=D0=B8=D1=8F?= Date: Tue, 18 Feb 2025 19:50:15 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=202.=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=B2=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20(SetUp=20=D0=BD=D0=B0=20TearDown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BuyerBusinessLogicContractTests.cs | 4 ++-- .../ComponentBusinessLogicTests.cs | 4 ++-- .../ManufacturerBusinessLogicContractTests.cs | 4 ++-- .../PostBusinessLogicContractTests.cs | 4 ++-- .../ProductBusinessLogicTests.cs | 21 +++++++------------ .../SalaryBusinessLogicContractTests.cs | 4 ++-- .../SaleBusinessLogicContractTests.cs | 4 ++-- .../WorkerBusinessLogicContractTests.cs | 4 ++-- 8 files changed, 22 insertions(+), 27 deletions(-) diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/BuyerBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/BuyerBusinessLogicContractTests.cs index f61600b..734718f 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/BuyerBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/BuyerBusinessLogicContractTests.cs @@ -20,8 +20,8 @@ internal class BuyerBusinessLogicContractTests _buyerBusinessLogicContract = new BuyerBusinessLogicContract(_buyerStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _buyerStorageContract.Reset(); } diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ComponentBusinessLogicTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ComponentBusinessLogicTests.cs index 10b965e..8210a15 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ComponentBusinessLogicTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ComponentBusinessLogicTests.cs @@ -26,8 +26,8 @@ namespace NorthBridgeTest.BusinessLogicsContractsTests _componentBusinessLogicContract = new ComponentBusinessLogicContract(_componentStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _componentStorageContract.Reset(); } diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ManufacturerBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ManufacturerBusinessLogicContractTests.cs index 608dcb0..b4b9a10 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ManufacturerBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ManufacturerBusinessLogicContractTests.cs @@ -20,8 +20,8 @@ internal class ManufacturerBusinessLogicContractTests _manufacturerBusinessLogicContract = new ManufacturerBusinessLogicContract(_manufacturerStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _manufacturerStorageContract.Reset(); } diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/PostBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/PostBusinessLogicContractTests.cs index 9e0c417..a42b95a 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/PostBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/PostBusinessLogicContractTests.cs @@ -21,8 +21,8 @@ internal class PostBusinessLogicContractTests _postBusinessLogicContract = new PostBusinessLogicContract(_postStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _postStorageContract.Reset(); } diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ProductBusinessLogicTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ProductBusinessLogicTests.cs index 4682885..1756a07 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ProductBusinessLogicTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/ProductBusinessLogicTests.cs @@ -4,11 +4,6 @@ using NorthBridgeBusinessLogic.Implementations; using NorthBridgeContract.DataModels; using NorthBridgeContract.Enums; using NorthBridgeContract.StoragesContracts; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace NorthBridgeTest.BusinessLogicsContractsTests { @@ -27,8 +22,8 @@ namespace NorthBridgeTest.BusinessLogicsContractsTests _productBusinessLogicContract = new ProductBusinessLogicContract(_productStorageContract.Object, _logger.Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _productStorageContract.Reset(); } @@ -38,16 +33,16 @@ namespace NorthBridgeTest.BusinessLogicsContractsTests { // Arrange var components = new List - { + { new ComponentDataModel(Guid.NewGuid().ToString(), "Component 1", ComponentType.RAM, Guid.NewGuid().ToString(), 100, false), new ComponentDataModel(Guid.NewGuid().ToString(), "Component 2", ComponentType.Processor, Guid.NewGuid().ToString(), 200, true) - }; + }; var products = new List - { + { new ProductDataModel(Guid.NewGuid().ToString(), "Product 1", Guid.NewGuid().ToString(), true, components), new ProductDataModel(Guid.NewGuid().ToString(), "Product 2", Guid.NewGuid().ToString(), false, components) - }; + }; _productStorageContract.Setup(x => x.GetList(It.IsAny())).Returns(products); @@ -69,10 +64,10 @@ namespace NorthBridgeTest.BusinessLogicsContractsTests { // Arrange var components = new List - { + { new ComponentDataModel(Guid.NewGuid().ToString(), "Component 1", ComponentType.RAM, Guid.NewGuid().ToString(), 100, false), new ComponentDataModel(Guid.NewGuid().ToString(), "Component 2", ComponentType.Processor, Guid.NewGuid().ToString(), 200, true) - }; + }; var product = new ProductDataModel(Guid.NewGuid().ToString(), "Product 1", Guid.NewGuid().ToString(), true, components); // Проверка, что метод добавления работает diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SalaryBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SalaryBusinessLogicContractTests.cs index a927281..71bece5 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SalaryBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SalaryBusinessLogicContractTests.cs @@ -28,8 +28,8 @@ internal class SalaryBusinessLogicContractTests _saleStorageContract.Object, _postStorageContract.Object, _workerStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _salaryStorageContract.Reset(); _saleStorageContract.Reset(); diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SaleBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SaleBusinessLogicContractTests.cs index 25e84e8..5e7cde6 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SaleBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/SaleBusinessLogicContractTests.cs @@ -21,8 +21,8 @@ internal class SaleBusinessLogicContractTests _saleBusinessLogicContract = new SaleBusinessLogicContract(_saleStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _saleStorageContract.Reset(); } diff --git a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/WorkerBusinessLogicContractTests.cs b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/WorkerBusinessLogicContractTests.cs index 37d8b58..0b2de5c 100644 --- a/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/WorkerBusinessLogicContractTests.cs +++ b/NorthBridge/NorthBridgeTest/BusinessLogicsContractsTests/WorkerBusinessLogicContractTests.cs @@ -20,8 +20,8 @@ internal class WorkerBusinessLogicContractTests _workerBusinessLogicContract = new WorkerBusinessLogicContract(_workerStorageContract.Object, new Mock().Object); } - [SetUp] - public void SetUp() + [TearDown] + public void TearDown() { _workerStorageContract.Reset(); }