public UninstallAllCommandViewModel(UninstallCommand command, ICollection <IInstalledPackage> packages) { Mock <UninstallAllCommand.IViewModel> mock = new Mock <UninstallAllCommand.IViewModel>(); mock .SetupGet(vm => vm.Uninstall) .Callback(() => CommandCalled.Increment()) .Returns(command); mock .SetupGet(vm => vm.Packages) .Callback(() => PackagesCalled.Increment()) .Returns(new ObservableCollection <IInstalledPackage>(packages)); Object = mock.Object; }
public UpdateAllCommandViewModel(UpdateCommand command, ICollection <PackageUpdateViewModel> packages) { Mock <UpdateAllCommand.IViewModel> mock = new Mock <UpdateAllCommand.IViewModel>(); mock .SetupGet(vm => vm.Update) .Callback(() => CommandCalled.Increment()) .Returns(command); mock .SetupGet(vm => vm.Packages) .Callback(() => PackagesCalled.Increment()) .Returns(new ObservableCollection <PackageUpdateViewModel>(packages)); Object = mock.Object; }