Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the page.
        /// </summary>
        /// <returns></returns>
        public Task Initialize()
        {
            return(Task.Run(() =>
            {
                var element = !string.IsNullOrEmpty(Id)
                    ? _cache.GetGroup(Id)
                    : _cache.Root;

                // TODO: handle group not found
                var group = new GroupItemModel(element);
                DisplayName = group.Name;

                var groups = group
                             .ListGroups()
                             .Select(x => new GroupItemViewModel(x));

                var entries = group
                              .ListEntries()
                              .Select(x => new EntryItemViewModel(x));

                _items.AddRange(groups
                                .Concat <object>(entries));
            }));
        }
Ejemplo n.º 2
0
 public void ListGroups_should_parse_groups()
 {
     Assert.Equal(new[] { "test", "gfdg" }, _group
                  .ListGroups()
                  .Select(x => x.Name));
 }