Еще один итог

This commit is contained in:
Glliza 2025-02-27 16:30:42 +04:00
parent 16afbd1ce1
commit 2041f50390
5 changed files with 9 additions and 11 deletions

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using PuferFishContracts.BusinessLogicsContracts;
using PuferFishContracts.DataModels;
using PuferFishContracts.Enums;
using PuferFishContracts.Exceptions;
using PuferFishContracts.Extensions;
using PuferFishContracts.StoragesContracts;
@ -17,8 +18,8 @@ internal class PointsBusinessLogicContract(IPointsStorageContract pointsStorageC
private readonly ILogger _logger = logger;
private readonly IPointsStorageContract _pointsStorageContract = pointsStorageContract;
private readonly ISaleStorageContract _saleStorageContract = saleStorageContract;
//private readonly IPostStorageContract _postStorageContract = postStorageContract;
private readonly IBuyerStorageContract _buyerStorageContract = buyerStorageContract;
public List<PointsDataModel> GetAllPointsByPeriod(DateTime fromDate, DateTime toDate)
{
_logger.LogInformation("GetAllSalaries params: {fromDate}, {toDate}",

View File

@ -18,6 +18,7 @@ internal class ProductBusinessLogicContract(IProductStorageContract productStora
{
private readonly ILogger _logger = logger;
private readonly IProductStorageContract _productStorageContract = productStorageContract;
public List<ProductDataModel> GetAllProducts(bool onlyActive)
{
_logger.LogInformation("GetAllProducts params: {onlyActive}", onlyActive);

View File

@ -18,6 +18,7 @@ internal class WorkerBusinessLogicContract(IWorkerStorageContract workerStorageC
private readonly ILogger _logger = logger;
private readonly IWorkerStorageContract _workerStorageContract =
workerStorageContract;
public List<WorkerDataModel> GetAllWorkers(bool onlyActive = true)
{
_logger.LogInformation("GetAllWorkers params: {onlyActive}",
@ -107,3 +108,4 @@ new NullListException();
_workerStorageContract.DelElement(id);
}
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Moq;
using PuferFishBusinessLogic.Implementations;
using PuferFishContracts.DataModels;
@ -201,9 +196,8 @@ internal class PointsBusinessLogicContractTests
{
// Arrange
var buyerId = Guid.NewGuid().ToString();
var expectedPoints = 100.0; // Ожидаемое количество баллов
var expectedPoints = 100.0;
// Установим значение Points для покупателя равным expectedPoints
_buyerStorageContract.Setup(x => x.GetList())
.Returns(new List<BuyerDataModel> { new BuyerDataModel(buyerId, "Test", "123456789", expectedPoints) });