Ejemplo n.º 1
0
        private static void InitializeInventory()
        {
            customerId = store.CreateCustomer();
            var customer = store.GetCustomer(customerId);

            customer.BonusPoints = 100;

            // rented casettes
            VideoTitle title = new VideoTitle("Out of Africa", 1985, VideoTitle.TitleType.Old);

            store.AddCasette(title);
            RentTitle(store.FindTitle(title.Name, title.Year), 7);

            title = new VideoTitle("Spider-Man", 2002, VideoTitle.TitleType.Regular);
            store.AddCasette(title);
            RentTitle(store.FindTitle(title.Name, title.Year), 5);

            title = new VideoTitle("Spider-Man 3", 2007, VideoTitle.TitleType.Regular);
            store.AddCasette(title);
            RentTitle(store.FindTitle(title.Name, title.Year), 2);

            // available casettes
            title = new VideoTitle("Parallels", 2015, VideoTitle.TitleType.New);
            store.AddCasette(title);

            title = new VideoTitle("Casablanka", 1943, VideoTitle.TitleType.Old);
            store.AddCasette(title);

            title = new VideoTitle("District 9", 2009, VideoTitle.TitleType.Regular);
            store.AddCasette(title);

            title = new VideoTitle("Skin Trade", 2014, VideoTitle.TitleType.New);
            store.AddCasette(title);
        }
Ejemplo n.º 2
0
        public void AddedCasetteShouldBeInRepository()
        {
            var title = helper.GetBrandNewTitle();

            repo.Titles.Add(title);

            store.AddCasette(title);

            Assert.AreEqual(title.Name, repo.Casettes[0].Title.Name);
            Assert.AreEqual(title.Year, repo.Casettes[0].Title.Year);
        }