public void MessageMailBoxViewModel() { var model = new MessageMailBoxViewModel(); Assert.AreNotEqual(model.Folders, null); Assert.AreNotEqual(model.Tags, null); }
public ActionResult Index(int? id) { var foldersForUser = messageService.GetAllFoldersForUser(SessionManager.CurrentUsername); var currentFolder = messageService.GetFolder(SessionManager.CurrentUsername, id); var mapper = AutoMapperConfiguration.GetMapper(); var currentFolderViewModel = mapper.Map<UserMessageFolder, MessageMailBoxFolderViewModel>(currentFolder); currentFolderViewModel.Folders = mapper.Map<List<UserMessageFolder>, List<MessageMailBoxFolderViewModel>>(foldersForUser); var model = new MessageMailBoxViewModel() { CurrentFolder = currentFolderViewModel, Folders = mapper.Map<List<UserMessageFolder>, List<MessageMailBoxFolderViewModel>>(foldersForUser) }; SessionManager.CurrentFolderId = currentFolder.Id; return View(model); }