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);
        }
示例#2
0
 public TastesController(ITastesService tastesService, ICigarService cigarService)
 {
     this.tastesService = tastesService;
     this.cigarService  = cigarService;
 }
示例#3
0
 public CigarsController(ICigarService cigarService)
 {
     this.cigarService = cigarService;
 }
示例#4
0
 public SizesController(ISizeService sizeService, ICigarService cigarService)
 {
     this.sizeService  = sizeService;
     this.cigarService = cigarService;
 }
示例#5
0
 public BrandsController(IBrandService brandService, ICigarService cigarService, IReviewService reviewService)
 {
     this.brandService  = brandService;
     this.cigarService  = cigarService;
     this.reviewService = reviewService;
 }
示例#6
0
 public HomeController(ICigarService cigarService, IPictureService pictureService)
 {
     this.cigarService   = cigarService;
     this.pictureService = pictureService;
 }
 public StrenghtsController(IStrenghtService strenghtsService, ICigarService cigarService)
 {
     this.strenghtsService = strenghtsService;
     this.cigarService     = cigarService;
 }