public async void Initialize_ServiceHasFriends_FriendsGetsSet() { m_httpClientMock.Setup(s => s.GetAsync(It.IsAny <Uri>())).ReturnsAsync("[\"Carl\"]"); await m_mainViewModel.Initialize(); Assert.NotEmpty(m_mainViewModel.Friends); }
public async Task Initialize() { var initialize = _mainViewModel?.Initialize(); if (initialize != null) { await initialize; } }
public MainWindow(IMainViewModel mainViewModel) { InitializeComponent(); DataContext = mainViewModel; mainViewModel.CloseWindow += (sender, arguments) => Close(); mainViewModel.ShowHideWindow += MainViewModelOnShowHideWindow; mainViewModel.Initialize(); }