public void TestAll() { IEnumerable<Notice> n1 = rep.All(); IEnumerable<Notice> n2 = rep.All(x => x.Active == true); IEnumerable<Notice> n3 = rep.All(x => x.Active); IEnumerable<Notice> n4 = rep.All(x => x.Active == true, x => x.Active); IEnumerable<ViewModel> n5 = rep.All(x => x.Active == true, x => x.Active, s => new ViewModel { Id = s.Id, Title = s.Title }); IGroupOrderBy<Notice> groupOrderBy = GroupOrderBy<Notice>.Create(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IEnumerable<Notice> n6 = rep.All(groupOrderBy); IEnumerable<Notice> n7 = rep.All(groupOrderBy, x => x.Active == true); IEnumerable<ViewModel> n8 = rep.All(groupOrderBy, x => x.Active == true, s => new ViewModel { Id = s.Id, Title = s.Title }); ConfigurationOrderBy<Notice> configNotice = new ConfigurationOrderBy<Notice>(); configNotice.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IEnumerable<Notice> n9 = rep.All(configNotice); ConfigurationOrderBySelect<Notice, ViewModel> configNoticeViewModel = new ConfigurationOrderBySelect<Notice, ViewModel>(); configNoticeViewModel.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); configNoticeViewModel.Select.Set(s => new ViewModel() { Id = s.Id, Title = s.Title }); IList<ViewModel> n10 = rep.All(configNoticeViewModel); IEnumerable<Notice> n11 = rep.All<ConfigurationOrderByLimit<Notice>>(a => { a.OrderBy.Add(x => x.Id); a.Page = 1; a.Total = 2; }); IList<ViewModel> n12 = rep.All<ConfigurationOrderBySelect<Notice, ViewModel>, ViewModel>(a => { a.OrderBy.Add(x => x.Id); a.Select.Set(s => new ViewModel { Id = s.Id, Title = s.Title }); }); Assert.NotNull(n1); Assert.NotNull(n2); Assert.NotNull(n3); Assert.NotNull(n4); Assert.NotNull(n5); Assert.NotNull(n6); Assert.NotNull(n7); Assert.NotNull(n8); Assert.NotNull(n9); Assert.NotNull(n10); Assert.NotNull(n11); Assert.NotNull(n12); }
private static void ToList(RepositoryNoticeContract rep) { IList<Notice> n1 = rep.List(); IList<Notice> n2 = rep.List(x => x.Active); IList<Notice> n3 = rep.List(x => x.Active == false); IList<Notice> n4 = rep.List(x => x.Active, 1, 10); IList<Notice> n5 = rep.List(c => c.Id > 0, x => x.Active.Value, true); IList<Notice> n6 = rep.List(c => c.Id > 0, x => x.Active.Value, 1); IList<ViewModel> n7 = rep.List(c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n8 = rep.List(x => x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n9 = rep.List(x => x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); IList<ViewModel> n10 = rep.List(x => x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); IGroupOrderBy<Notice> groupOrderBy = GroupOrderBy<Notice>.Create(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IList<Notice> n11 = rep.List(groupOrderBy); IList<Notice> n12 = rep.List(groupOrderBy, 1); IList<Notice> n13 = rep.List(groupOrderBy, x => x.Id > 0, true); IList<Notice> n14 = rep.List(groupOrderBy, x => x.Id > 0, 1); IList<ViewModel> n15 = rep.List(groupOrderBy, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n16 = rep.List(groupOrderBy, x => x.TagId > 0, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n17 = rep.List(groupOrderBy, x => x.TagId > 0, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); ConfigurationOrderBy<Notice> configNotice = new ConfigurationOrderBy<Notice>(); configNotice.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IList<Notice> n18 = rep.List(configNotice); ConfigurationOrderBySelect<Notice, ViewModel> configNoticeViewModel = new ConfigurationOrderBySelect<Notice, ViewModel>(); configNoticeViewModel.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); configNoticeViewModel.Select.Set(s => new ViewModel() { Id = s.Id, Title = s.Title }); IList<ViewModel> n19 = rep.List(configNoticeViewModel); IList<Notice> n20 = rep.List<ConfigurationOrderByLimit<Notice>>(a => { a.OrderBy.Add(x => x.Id); a.Page = 1; a.Total = 2; }); IList<ViewModel> n21 = rep.List<ConfigurationOrderBySelect<Notice, ViewModel>, ViewModel>(a => { a.OrderBy.Add(x => x.Id); a.Select.Set(s => new ViewModel { Id = s.Id, Title = s.Title }); }); }
public void TestList() { IList<Notice> n1 = rep.List(); IList<Notice> n2 = rep.List(x => x.Active); IList<Notice> n3 = rep.List(x => x.Active == false); IList<Notice> n4 = rep.List(x => x.Active, 1, 10); IList<Notice> n5 = rep.List(c => c.Id > 0, x => x.Active.Value, true); IList<Notice> n6 = rep.List(c => c.Id > 0, x => x.Active.Value, 1); IList<ViewModel> n7 = rep.List(c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n8 = rep.List(x=> x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n9 = rep.List(x => x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); IList<ViewModel> n10 = rep.List(x => x.TagId > 0, c => c.Id, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); IGroupOrderBy<Notice> groupOrderBy = GroupOrderBy<Notice>.Create(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IList<Notice> n11 = rep.List(groupOrderBy); IList<Notice> n12 = rep.List(groupOrderBy, 1); IList<Notice> n13 = rep.List(groupOrderBy, x => x.Id > 0, true); IList<Notice> n14 = rep.List(groupOrderBy, x => x.Id > 0, 1); IList<ViewModel> n15 = rep.List(groupOrderBy, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n16 = rep.List(groupOrderBy, x => x.TagId > 0, x => new ViewModel { Id = x.Id, Title = x.Title }); IList<ViewModel> n17 = rep.List(groupOrderBy, x => x.TagId > 0, x => new ViewModel { Id = x.Id, Title = x.Title }, 1); ConfigurationOrderBy<Notice> configNotice = new ConfigurationOrderBy<Notice>(); configNotice.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IList<Notice> n18 = rep.List(configNotice); ConfigurationOrderBySelect<Notice, ViewModel> configNoticeViewModel = new ConfigurationOrderBySelect<Notice, ViewModel>(); configNoticeViewModel.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); configNoticeViewModel.Select.Set(s => new ViewModel() { Id = s.Id, Title = s.Title }); IList<ViewModel> n19 = rep.List(configNoticeViewModel); IList<Notice> n20 = rep.List<ConfigurationOrderByLimit<Notice>>(a => { a.OrderBy.Add(x => x.Id); a.Page = 1; a.Total = 2; }); IList<ViewModel> n21 = rep.List<ConfigurationOrderBySelect<Notice, ViewModel>, ViewModel>(a => { a.OrderBy.Add(x => x.Id); a.Select.Set(s => new ViewModel { Id = s.Id, Title = s.Title }); }); Assert.NotNull(n1); Assert.NotNull(n2); Assert.NotNull(n3); Assert.NotNull(n4); Assert.NotNull(n5); Assert.NotNull(n6); Assert.NotNull(n7); Assert.NotNull(n8); Assert.NotNull(n9); Assert.NotNull(n10); Assert.NotNull(n21); Assert.NotNull(n11); Assert.NotNull(n12); Assert.NotNull(n13); Assert.NotNull(n14); Assert.NotNull(n15); Assert.NotNull(n16); Assert.NotNull(n17); Assert.NotNull(n18); Assert.NotNull(n19); Assert.NotNull(n20); Assert.NotNull(n21); }
private static void ToAll(RepositoryNoticeContract rep) { IEnumerable<Notice> n1 = rep.All(); IEnumerable<Notice> n2 = rep.All(x => x.Active == true); IEnumerable<Notice> n3 = rep.All(x => x.Active); IEnumerable<Notice> n4 = rep.All(x => x.Active == true, x => x.Active); IEnumerable<ViewModel> n5 = rep.All(x => x.Active == true, x => x.Active, s => new ViewModel { Id = s.Id, Title = s.Title }); IGroupOrderBy<Notice> groupOrderBy = GroupOrderBy<Notice>.Create(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IEnumerable<Notice> n6 = rep.All(groupOrderBy); IEnumerable<Notice> n7 = rep.All(groupOrderBy, x => x.Active == true); IEnumerable<ViewModel> n8 = rep.All(groupOrderBy, x => x.Active == true, s => new ViewModel { Id = s.Id, Title = s.Title }); ConfigurationOrderBy<Notice> configNotice = new ConfigurationOrderBy<Notice>(); configNotice.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); IEnumerable<Notice> n9 = rep.All(configNotice); ConfigurationOrderBySelect<Notice, ViewModel> configNoticeViewModel = new ConfigurationOrderBySelect<Notice, ViewModel>(); configNoticeViewModel.OrderBy.Add(x => x.Id, Order.Asc).Add(x => x.TagId, Order.Desc); configNoticeViewModel.Select.Set(s => new ViewModel() { Id = s.Id, Title = s.Title }); IList<ViewModel> n10 = rep.All(configNoticeViewModel); IEnumerable<Notice> n11 = rep.All<ConfigurationOrderByLimit<Notice>>(a => { a.OrderBy.Add(x => x.Id); a.Page = 1; a.Total = 2; }); IList<ViewModel> n12 = rep.All<ConfigurationOrderBySelect<Notice, ViewModel>, ViewModel>(a => { a.OrderBy.Add(x => x.Id); a.Select.Set(s => new ViewModel { Id = s.Id, Title = s.Title }); }); }