예제 #1
0
        public SaleItemTests()
        {
            genres = new List <Genre>();
            var defaultCashback = new DefaultCashback();

            var pop = new Genre(null, "Pop");

            pop.AddCashbackConfigs(defaultCashback.GetDefaultCashback(pop.Id, pop.Name));

            var mpb = new Genre(null, "MPB");

            mpb.AddCashbackConfigs(defaultCashback.GetDefaultCashback(mpb.Id, mpb.Name));

            var classic = new Genre(null, "Classical");

            classic.AddCashbackConfigs(defaultCashback.GetDefaultCashback(classic.Id, classic.Name));

            var rock = new Genre(null, "Rock");

            rock.AddCashbackConfigs(defaultCashback.GetDefaultCashback(rock.Id, rock.Name));

            genres.Add(pop);
            genres.Add(mpb);
            genres.Add(classic);
            genres.Add(rock);
        }
예제 #2
0
        public void AddCashbackConfigsTest()
        {
            var obj       = new Genre(null, "test genre 2");
            var cashbacks = new List <Cashback.Domain.Models.Cashback>();

            cashbacks.Add(new Domain.Models.Cashback(null, obj.Id, DayOfWeek.Monday, 15));
            cashbacks.Add(new Domain.Models.Cashback(null, obj.Id, DayOfWeek.Tuesday, 10));

            obj.AddCashbackConfigs(cashbacks);

            Assert.NotNull(obj);
            Assert.Equal(8, obj.Id.Length);
            Assert.NotNull(obj.Name);
            Assert.NotNull(obj.Cashbacks);
            Assert.Equal(2, obj.Cashbacks.Count());
        }