public void ShouldLoadFriend()
 {
     _viewModel.Load(_friendId);
     Assert.NotNull(_viewModel.Friend);
     Assert.Equal(_friendId, _viewModel.Friend.Id);
     _dataProviderMock.Verify(dp => dp.GetFriendById(_friendId), Times.Once);
 }
示例#2
0
        public void ShouldLoadFriend()
        {
            _friendEditViewModelMoq.Load(FriendId);

            Assert.NotNull(_friendEditViewModelMoq.Friend);
            Assert.Equal(FriendId, _friendEditViewModelMoq.Friend.Id);
            Assert.Equal("Thomas", _friendEditViewModelMoq.Friend.FirstName);
        }
示例#3
0
        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);
        }
示例#5
0
        public void ShouldLoadFriend()
        {
            viewModel.Load(friendId);

            Assert.NotNull(viewModel.Friend);
            Assert.Equal(friendId, viewModel.Friend.Id);
            friendDataProviderMock.Verify(provider => provider.GetFriendById(friendId), Times.Once);
        }