예제 #1
0
 public static MainWindowViewModel CreateWindowViewModel()
 {
     Func<string, ITag[], IAssigment> assigmentFactory = (s, tags) => new Assigment(s, tags);
     Func<ITag, ITagViewModel> tagViewModelFactory = (m) => new TagViewModel(m);
     var assigmentsCache = new AssigmentCache();
     var tagsCache = new TagsCache();
     var addAssigmentService = new AddAssigmentService(assigmentsCache, tagsCache, assigmentFactory, CreateTagFactory(tagsCache));
     var tagVisibilityService = new TagVisibilityService();
     Func<IAssigment, IAssigmentViewModel> assigmentViewModelFactory = (m) => new AssigmentViewModel(m, tagViewModelFactory, tagVisibilityService);
     Func<ITag, ISelectableTagViewModel> selectableTagViewModelFactory = (m) => new SelectableTagViewModel(m, tagVisibilityService);
     return new MainWindowViewModel(assigmentsCache,
         tagsCache,
         addAssigmentService,
         assigmentViewModelFactory,
         selectableTagViewModelFactory);
 }
예제 #2
0
 public TagsCacheTests()
 {
     _assigmentCache = new TagsCache();
 }