示例#1
0
        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;
        }
示例#2
0
        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;
        }