//rozdzial 6 film 8 4:34 <- pierwszy TDD public void ShouldAddFriendEditViewModelAndLoadAndSelectIt() { const int friendId = 7; _openFriendEditViewEvent.Publish(friendId); Assert.Single(_viewModel.FriendEditViewModels); var friendEditVm = _viewModel.FriendEditViewModels.First(); Assert.Equal(friendEditVm, _viewModel.SelectedFriendEditViewModel); _friendEditViewModelMocks.First().Verify(vm => vm.Load(friendId), Times.Once); }
public void ShouldAddFriendEditViewModelAndLoadAndSelectIt() { const int friendId = 7; _openFriendEditViewEvent.Publish(friendId); // If just checking one, XUnit wants to use Assert.Single rather than Assert.Equal Assert.Single(_viewModel.FriendEditViewModels); var friendEditVm = _viewModel.FriendEditViewModels.First(); Assert.Equal(friendEditVm, _viewModel.SelectedFriendEditViewModel); _friendEditViewModelMocks.First().Verify(vm => vm.Load(friendId), Times.Once); }
public void ShouldAddFriendEditViewModelAndLoadAndSelectIt() { openFriendEditViewEvent.Publish(1); Assert.Equal(1, mainViewModel.FriendEditViewModels.Count); IFriendEditViewModel selectedFriendEditViewModel = mainViewModel.FriendEditViewModels.First(); Assert.Equal(selectedFriendEditViewModel, mainViewModel.SelectedFriendEditViewModel); friendEditViewModelMocks.First().Verify(model => model.Load(1), Times.Once); }