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


C# Facade.GetGenreRepo方法代码示例

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


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

示例1: Genre_get_all_return_all_test

        public void Genre_get_all_return_all_test()
        {
            Genre temp = new Genre() { Name = "test" };
            Facade facade = new Facade();
            temp = facade.GetGenreRepo().Add(temp);

            facade = new Facade();
            Assert.IsNotNull(facade.GetGenreRepo().GetAll());
            Assert.AreNotEqual(0, facade.GetGenreRepo().GetAll().ToList().Count);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:10,代码来源:GenreRepositoryTest.cs

示例2: Movie_get_by_genre_return_empty_on_no_movies_test

        public void Movie_get_by_genre_return_empty_on_no_movies_test()
        {
            Facade facade = new Facade();
            Genre genre = new Genre() { Name = "test" };
            genre = facade.GetGenreRepo().Add(genre);

            facade = new Facade();
            Assert.AreEqual(facade.GetMovieRepo().GetMovieByGenre(genre).ToList().Count, 0);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:9,代码来源:MovieRepositoryTest.cs

示例3: Genre_added_on_call_test

        public void Genre_added_on_call_test()
        {
            Genre temp = new Genre() { Name = "test" };
            Facade facade = new Facade();
            temp = facade.GetGenreRepo().Add(temp);
            Context context = new Context();

            Assert.IsNotNull(context.Genres.FirstOrDefault(x=> x.Id == temp.Id));
            Assert.AreNotEqual(temp.Id, 0);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:10,代码来源:GenreRepositoryTest.cs

示例4: Genre_getgenrebymovie_return_multiple_test

        public void Genre_getgenrebymovie_return_multiple_test()
        {
            Facade facade = new Facade();
            Genre genre = new Genre() { Name = "test1" };
            Genre genretwo = new Genre() { Name = "test2" };
            List<Genre> list = new List<Genre>();
            //genre = facade.GetGenreRepo().Add(genre);
            //genretwo = facade.GetGenreRepo().Add(genretwo);
            list.Add(genre);
            list.Add(genretwo);
            Movie temp = new Movie() { Genres = list, Name = "test", Price = 120d, TrailerURL = "test" };
            temp = facade.GetMovieRepo().Add(temp);

            Assert.GreaterOrEqual(facade.GetGenreRepo().GetGenreByMovie(temp).ToList().Count, 2);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:15,代码来源:GenreRepositoryTest.cs

示例5: Movie_get_all_include_genres_test

        public void Movie_get_all_include_genres_test()
        {
            Facade facade = new Facade();
            Genre genre = new Genre() { Name = "test" };
            List<Genre> list = new List<Genre>();
            genre = facade.GetGenreRepo().Add(genre);
            list.Add(genre);
            Movie temp = new Movie() { Genres = list, Name = "test", Price = 120d, TrailerURL = "test" };
            temp = facade.GetMovieRepo().Add(temp);
            temp = facade.GetMovieRepo().Add(temp);

            facade = new Facade();
            Assert.IsNotNull(facade.GetMovieRepo().GetAll().ElementAt(0).Genres.FirstOrDefault());
            Assert.IsNotNull(facade.GetMovieRepo().GetAll().ElementAt(1).Genres.FirstOrDefault());
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:15,代码来源:MovieRepositoryTest.cs

示例6: 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

示例7: Genre_get_by_id_returns_test

        public void Genre_get_by_id_returns_test()
        {
            Genre temp = new Genre() { Name = "test" };
            Facade facade = new Facade();
            temp = facade.GetGenreRepo().Add(temp);

            facade = new Facade();
            Assert.AreEqual(temp.Name, facade.GetGenreRepo().Get(temp.Id).Name);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:9,代码来源:GenreRepositoryTest.cs

示例8: Genre_getgenrebymovie_throws_exception_on_movie_equals_null_test

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

示例9: Genre_add_throws_expection_on_genre_name_equals_null_test

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

示例10: Movie_update_updates_in_database_test

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

            Genre genre = new Genre() { Name = "test" };
            List<Genre> list = new List<Genre>();
            genre = facade.GetGenreRepo().Add(genre);
            list.Add(genre);
            Movie temp = new Movie() { Genres = list, Name = "test", Price = 120d, TrailerURL = "test" };
            facade.GetMovieRepo().Add(temp);

            temp.Name = "Changed";

            facade = new Facade();
            Assert.IsTrue(facade.GetMovieRepo().Update(temp));

            facade = new Facade();
            Assert.AreEqual(facade.GetMovieRepo().Get(temp.Id).Name, "Changed");
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:19,代码来源:MovieRepositoryTest.cs

示例11: Genre_update_throws_expection_on_genre_name_equals_null_test

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

示例12: Genre_update_throws_expection_on_genre_equals_null_test

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

示例13: Genre_remove_throw_exception_on_null_movie_test

 public void Genre_remove_throw_exception_on_null_movie_test()
 {
     Facade facade = new Facade();
     facade.GetGenreRepo().Remove(-1);
 }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:5,代码来源:GenreRepositoryTest.cs

示例14: Movie_get_by_id_includes_genres_test

        public void Movie_get_by_id_includes_genres_test()
        {
            Facade facade = new Facade();
            Genre genre = new Genre() { Name = "test" };
            List<Genre> list = new List<Genre>();
            genre = facade.GetGenreRepo().Add(genre);
            list.Add(genre);
            Movie temp = new Movie() { Genres = list, Name = "test", Price = 120d, TrailerURL = "test" };
            temp = facade.GetMovieRepo().Add(temp);

            facade = new Facade();
            Assert.AreEqual(genre.Name, facade.GetMovieRepo().Get(temp.Id).Genres.FirstOrDefault().Name);
            Assert.AreEqual(genre.Id, facade.GetMovieRepo().Get(temp.Id).Genres.FirstOrDefault().Id);
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:14,代码来源:MovieRepositoryTest.cs

示例15: Genre_remove_removing_from_database_test

        public void Genre_remove_removing_from_database_test()
        {
            Genre temp = new Genre() { Name = "test" };
            Facade facade = new Facade();
            temp = facade.GetGenreRepo().Add(temp);

            facade = new Facade();
            facade.GetGenreRepo().Remove(temp.Id);

            facade = new Facade();

            Assert.IsNull(facade.GetGenreRepo().Get(temp.Id));
        }
开发者ID:nordtorp95,项目名称:MovieWebApi,代码行数:13,代码来源:GenreRepositoryTest.cs


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