// using AutoMapper;
// using Silk_Road_Api;
// using Silk_Road_Api.Models;
// using Silk_Road_Api.Repositories;
// using Silk_Road_Api.Services;
// using Silk_Road_Api.ViewModels;

// namespace Silk_Road_Api_Test;

// public class ManufacturerServiceTest
// {
//     [Fact]
//     public async void GetManufacturer_ValidId_ReturnsAManufacturer()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));

//         // Act
//         var drug = await manufacturerService.GetManufacturer(1);

//         // Assert
//         Assert.NotNull(drug);
//         Assert.Equal(1, drug.id);
//     }

//     [Fact]
//     public async void GetManufacturer_InvalidId_ThrowsError()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));

//         // Act
//         var act = async () => await manufacturerService.GetManufacturer(100);

//         // Assert
//         await Assert.ThrowsAsync<Exception>(act);
//     }
//     [Fact]
//     public async void GetManufacturers_WithPageSize1andPage1_Returns1Drugs()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));
//         SearchInput searchInput = new SearchInput
//         {
//             PageSize = 1,
//             Page = 1
//         };
//         // Act
//         var manufacturers = await manufacturerService.GetManufacturers(searchInput);
//         // Assert
//         Assert.NotNull(manufacturers);
//         Assert.Equal(1, manufacturers.Total);
//         Assert.Equal(1, manufacturers.Items.Count);
//     }

//     [Fact]
//     public async void AddDrugs_Succesful()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));
//         ManufacturerViewModel manufacturer = new ManufacturerViewModel
//         {
//             name = "Azteca",
//             contact = "mail@azteca.com",
//             address = "test",
//         };
//         // Act
//         var result = await manufacturerService.AddManufacturer(manufacturer);
//         // Assert
//         Assert.True(result);
//     }

//     [Fact]
//     public async void UpdateDrugs_Succesful()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));
//         ManufacturerViewModel manufacturer = new ManufacturerViewModel
//         {
//             id = 1,
//             name = "Azteca",
//             contact = "mail@azteca.com",
//             address = "test",
//         };
//         // Act
//         var result = await manufacturerService.UpdateManufacturer(manufacturer);
//         // Assert
//         Assert.True(result);
//     }

//     [Fact]
//     public async void DeleteDrugs_Succesful()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));
//         // Act
//         var result = await manufacturerService.DeleteManufacturer(1);
//         // Assert
//         Assert.True(result);
//     }

//     [Fact]
//     public async void DeleteDrugs_InvalidId_ReturnsFalse()
//     {
//         // Arrange
//         IManufacturerService manufacturerService = new ManufacturerService(new MemoryRepository(), new MemoryManufacturerRepository(), new Mapper(new MapperConfiguration(cfg => cfg.AddProfile<ManufacturerProfile>())));
//         // Act
//         var result = await manufacturerService.DeleteManufacturer(100);
//         // Assert
//         Assert.False(result);
//     }

// }
