当前位置: 首页>>代码示例>>C#>>正文


C# Facade.GetOrderMovieRepo方法代码示例

本文整理汇总了C#中Facade.GetOrderMovieRepo方法的典型用法代码示例。如果您正苦于以下问题:C# Facade.GetOrderMovieRepo方法的具体用法?C# Facade.GetOrderMovieRepo怎么用?C# Facade.GetOrderMovieRepo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facade的用法示例。


在下文中一共展示了Facade.GetOrderMovieRepo方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OrderMovie_get_all_return_multiple_test

        public void OrderMovie_get_all_return_multiple_test()
        {
            Facade facade = new Facade();
            Movie mov = facade.GetMovieRepo().Add(SetMovie());
            Order or1 = facade.GetOrderRepo().Add(SetOrder());
            Order or2 = facade.GetOrderRepo().Add(SetOrder());
            OrderMovie om = new OrderMovie() { Movie = mov, Order = or1 };
            OrderMovie om2 = new OrderMovie() { Movie = mov, Order = or2 };

            facade.GetOrderMovieRepo().Add(om);
            facade.GetOrderMovieRepo().Add(om);

            facade = new Facade();
            Assert.GreaterOrEqual(facade.GetOrderMovieRepo().GetAll().ToList().Count, 2);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:15,代码来源:OrderMovieRepositoryTest.cs

示例2: OrderMovie_getall_oms_by_order_test

        public void OrderMovie_getall_oms_by_order_test()
        {
            Facade facade = new Facade();
            Movie mov = facade.GetMovieRepo().Add(SetMovie());
            Movie mov2 = SetMovie();
            mov2.Name = "changed";
            mov2 = facade.GetMovieRepo().Add(mov2);
            Order or1 = facade.GetOrderRepo().Add(SetOrder());
            OrderMovie om = new OrderMovie() { Movie = mov, Order = or1 };
            OrderMovie om2 = new OrderMovie() { Movie = mov2, Order = or1 };

            om = facade.GetOrderMovieRepo().Add(om);
            om2 = facade.GetOrderMovieRepo().Add(om2);

            facade = new Facade();
            Assert.GreaterOrEqual(facade.GetOrderMovieRepo().GetAllOrderMoviesByOrder(or1).ToList().Count, 2);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:17,代码来源:OrderMovieRepositoryTest.cs

示例3: OrderMovie_get_works_test

        public void OrderMovie_get_works_test()
        {
            Facade facade = new Facade();
            OrderMovie om = new OrderMovie() { Movie = SetMovie(), Order = SetOrder() };

            om = facade.GetOrderMovieRepo().Add(om);

            facade = new Facade();
            Assert.AreEqual(facade.GetOrderMovieRepo().Get(om.Id).Movie.Name, "The Martian");
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:10,代码来源:OrderMovieRepositoryTest.cs

示例4: OrderMovie_get_movie_by_om_returning_movie_test

        public void OrderMovie_get_movie_by_om_returning_movie_test()
        {
            Facade facade = new Facade();
            Movie mov = facade.GetMovieRepo().Add(SetMovie());
            Order or1 = facade.GetOrderRepo().Add(SetOrder());
            OrderMovie om = new OrderMovie() { Movie = mov, Order = or1 };

            om = facade.GetOrderMovieRepo().Add(om);

            facade = new Facade();
            Assert.AreEqual(facade.GetOrderMovieRepo().GetMovieByOrderMovie(om).Name, mov.Name);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:12,代码来源:OrderMovieRepositoryTest.cs

示例5: Order_added_on_create_test

        public void Order_added_on_create_test()
        {
            Facade facade = new Facade();

            Customer cus = new Customer()
            {
                FirstName = "Test",
                Address = "TestAddress",
                BirthDate = DateTime.Now,
                Email = "TestEmail",
                PhoneNumber = 1234
            };
            cus = facade.GetCustomerRepo().Add(cus);
            Genre genre = new Genre() { Name = "TestGenre" };
            List<Genre> list = new List<Genre>();
            genre = facade.GetGenreRepo().Add(genre);
            list.Add(genre);
            Movie movie = new Movie()
            {
                Name = "TestName",
                Genres = list,
                Price = 123,
                TrailerURL = "TestURL"
            };
            movie = facade.GetMovieRepo().Add(movie);
            Order order = new Order()
            {
                Customer = cus,
                Date = DateTime.Now
            };
            OrderMovie om = new OrderMovie() { Movie = movie, Order = order };
            om = facade.GetOrderMovieRepo().Add(om);

            order.OrderMovie.Add(om);

            order = facade.GetOrderRepo().Add(order);

            facade = new Facade();

            Assert.AreEqual(order.Customer.FirstName, facade.GetOrderRepo().Get(order.Id).Customer.FirstName);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:41,代码来源:OrderRepositoryTest.cs

示例6: OrderMovie_remove_removes_from_db_test

        public void OrderMovie_remove_removes_from_db_test()
        {
            Facade facade = new Facade();
            Movie mov = facade.GetMovieRepo().Add(SetMovie());
            Order or1 = facade.GetOrderRepo().Add(SetOrder());
            OrderMovie om = new OrderMovie() { Movie = mov, Order = or1 };

            om = facade.GetOrderMovieRepo().Add(om);

            facade = new Facade();
            facade.GetOrderMovieRepo().Remove(om.Id);

            facade = new Facade();
            Assert.IsNull(facade.GetOrderMovieRepo().Get(om.Id));
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:15,代码来源:OrderMovieRepositoryTest.cs

示例7: OrderMovie_add_throws_exception_on_null_test

 public void OrderMovie_add_throws_exception_on_null_test()
 {
     Facade facade = new Facade();
     facade.GetOrderMovieRepo().Add(null);
 }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:5,代码来源:OrderMovieRepositoryTest.cs

示例8: OrderMovie_update_updates_in_db_test

        public void OrderMovie_update_updates_in_db_test()
        {
            Facade facade = new Facade();
            Movie mov = facade.GetMovieRepo().Add(SetMovie());
            Movie mov2 = SetMovie();
            mov2.Name = "changed";
            mov2 = facade.GetMovieRepo().Add(mov2);
            Order or1 = facade.GetOrderRepo().Add(SetOrder());
            OrderMovie om = new OrderMovie() { Movie = mov, Order = or1 };

            om = facade.GetOrderMovieRepo().Add(om);

            facade = new Facade();
            om.Movie = mov2;

            Assert.IsTrue(facade.GetOrderMovieRepo().Update(om));

            facade = new Facade();
            Assert.AreEqual(mov2.Name, facade.GetOrderMovieRepo().Get(om.Id).Movie.Name);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:20,代码来源:OrderMovieRepositoryTest.cs

示例9: OrderMovie_update_throws_exception_on_null_test

 public void OrderMovie_update_throws_exception_on_null_test()
 {
     Facade facade = new Facade();
     facade.GetOrderMovieRepo().Update(null);
 }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:5,代码来源:OrderMovieRepositoryTest.cs

示例10: OrderMovie_update_returns_false_on_om_not_exist_test

 public void OrderMovie_update_returns_false_on_om_not_exist_test()
 {
     Facade facade = new Facade();
     Assert.IsFalse(facade.GetOrderMovieRepo().Update(new OrderMovie()));
 }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:5,代码来源:OrderMovieRepositoryTest.cs


注:本文中的Facade.GetOrderMovieRepo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。