public void GetBannerService()
        {
            var uow = new UnitOfWork(new DigitalSignageDbContext("TestDigitalSignageTest"));

            BannerService cS = new BannerService();

            Banner Banner = new Banner();

            Banner.Name        = "nueva campaña";
            Banner.Description = "qsy";
            Banner.InitDate    = new DateTime().AddYears(2018);
            Banner.EndDate     = new DateTime().AddYears(2018);
            Banner.InitTime    = new TimeSpan();
            Banner.EndTime     = new TimeSpan();

            uow.BannerRepository.Add(Banner);
            uow.Complete();

            try
            {
                var result = cS.Get(Banner.Id);
                Assert.IsNotNull(result);
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
Esempio n. 2
0
 public BannerDTO Get(int id)
 {
     try
     {
         var banner = bannerService.Get(id);
         return(banner);
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Esempio n. 3
0
 public BannerDto Get(int id)
 {
     return(_bannerService.Get(id));
 }
Esempio n. 4
0
 public ActionResult <List <Banner> > Get() => _bannerService.Get();
 public ActionResult <List <Banner> > Get()
 {
     return(_bannerService.Get());
 }