Exemplo n.º 1
0
        public CigarServiceTests()
        {
            testData = new List <Cigar>
            {
                new Cigar {
                    Id = 1, Name = "Sample Cigar 1"
                },
                new Cigar {
                    Id = 2, Name = "Sample Cigar 2"
                },
                new Cigar {
                    Id = 3, Name = "Demo Cigar"
                },
            };

            mockCigarRepository = new Mock <ICigarRepository>();
            mockCigarRepository.Setup(x => x.GetFiltered(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(testData.ToAsyncEnumerable());
            mockCigarRepository.Setup(x => x.Exists(It.IsAny <int>())).Returns(Task.FromResult(true));

            mockUnitOfWork = new Mock <IUnitOfWork>();
            mockUnitOfWork.SetupGet(x => x.CigarRepository).Returns(mockCigarRepository.Object);

            cigarService = new CigarService(mockUnitOfWork.Object);
        }
Exemplo n.º 2
0
 public TastesController(ITastesService tastesService, ICigarService cigarService)
 {
     this.tastesService = tastesService;
     this.cigarService  = cigarService;
 }
Exemplo n.º 3
0
 public CigarsController(ICigarService cigarService)
 {
     this.cigarService = cigarService;
 }
Exemplo n.º 4
0
 public SizesController(ISizeService sizeService, ICigarService cigarService)
 {
     this.sizeService  = sizeService;
     this.cigarService = cigarService;
 }
Exemplo n.º 5
0
 public BrandsController(IBrandService brandService, ICigarService cigarService, IReviewService reviewService)
 {
     this.brandService  = brandService;
     this.cigarService  = cigarService;
     this.reviewService = reviewService;
 }
Exemplo n.º 6
0
 public HomeController(ICigarService cigarService, IPictureService pictureService)
 {
     this.cigarService   = cigarService;
     this.pictureService = pictureService;
 }
Exemplo n.º 7
0
 public StrenghtsController(IStrenghtService strenghtsService, ICigarService cigarService)
 {
     this.strenghtsService = strenghtsService;
     this.cigarService     = cigarService;
 }