Example #1
0
 public UnitOfWork(IApplicationDbContext context,
                   ICigarRepository cigarRepository)
 //ICountryRepository countryRepository,
 //IInventoryItemRepository inventoryItemRepository)
 {
     this.context    = context;
     CigarRepository = cigarRepository;
     //InventoryItemRepository = inventoryItemRepository;
     //CountryRepository = countryRepository;
 }
Example #2
0
        public CigarRepositoryTests()
        {
            var data = new List <Cigar>
            {
                new Cigar {
                    Id = 1, Name = "Test1", Country = "Finland"
                },
                new Cigar {
                    Id = 2, Name = "Test2", Country = "Germany"
                },
                new Cigar {
                    Id = 3, Name = "Temp4", Country = "France"
                },
                new Cigar {
                    Id = 4, Name = "Temp3", Country = "Finland"
                }
            }.AsQueryable();

            var mockDbSet   = DbContextHelpers.CreateMockDbSet(data);
            var mockContext = DbContextHelpers.CreateMockDbContext(mockDbSet.Object);

            cigarRepository = new CigarRepository(mockContext.Object);
        }
 public CigarController(ICigarRepository repo) =>
Example #4
0
 public ManufacturerController(ICigarRepository repo) =>
Example #5
0
 /// <summary>
 /// Creates a new instance of the <see cref="AddCigarCommandHandler" />
 /// class.
 /// </summary>
 /// <param name="cigarRepository">
 /// Required type used to persist the new cigar.
 /// </param>
 public AddCigarCommandHandler(ICigarRepository cigarRepository)
 {
     _cigarRepository = cigarRepository;
 }