public MainViewModel() { NotificationsViewModel = new NotificationsViewModel(); NewsViewModel = new NewsViewModel(); ReposViewModel = new UserRepositoriesViewModel(); IssuesViewModel = new UserIssuesViewModel(); this.Refresh(); GetCurrentUser(); }
public async void NotificationsVMShouldGetAllNotifications() { GitHubClientMock.Setup(m => m.Notification.GetAllForCurrent(It.IsAny<NotificationsRequest>())).Returns(() => Task.FromResult(new List<Notification>{new Notification()} as IReadOnlyList<Notification>)); var vm = new NotificationsViewModel(); await vm.Refresh(); GitHubClientMock.Verify(m => m.Notification.GetAllForCurrent(It.Is<NotificationsRequest>(nr => nr.All)), Times.Once()); Assert.AreEqual(1, vm.Notifications.Count()); }