public void ShouldLoadFriend() { _viewModel.Load(_friendId); Assert.NotNull(_viewModel.Friend); Assert.Equal(_friendId, _viewModel.Friend.Id); _dataProviderMock.Verify(dp => dp.GetFriendById(_friendId), Times.Once); }
public void ShouldLoadFriend() { _friendEditViewModelMoq.Load(FriendId); Assert.NotNull(_friendEditViewModelMoq.Friend); Assert.Equal(FriendId, _friendEditViewModelMoq.Friend.Id); Assert.Equal("Thomas", _friendEditViewModelMoq.Friend.FirstName); }
public void ShouldRaisePropertyChangedEventForFriend() { var fired = _viewModel.IsPropertyChangedFired( () => _viewModel.Load(_friendId), nameof(_viewModel.Friend)); Assert.True(fired); }
public void ShouldAcceptChangesWhenSaveCommandIsExecuted() { _viewModel.Load(_friendId); _viewModel.Friend.FirstName = "Changed"; _viewModel.SaveCommand.Execute(null); Assert.False(_viewModel.Friend.IsChanged); }
public void ShouldLoadFriend() { viewModel.Load(friendId); Assert.NotNull(viewModel.Friend); Assert.Equal(friendId, viewModel.Friend.Id); friendDataProviderMock.Verify(provider => provider.GetFriendById(friendId), Times.Once); }