public void PackageViewModels_ChildViewModelParent_IsInstalledPackagesViewModel() { CreateViewModel(); FakePackage package = AddPackageToProjectLocalRepository(); viewModel.ReadPackages(); CompleteReadPackagesTask(); PackageViewModel childViewModel = viewModel.PackageViewModels.First(); IPackageViewModelParent parent = childViewModel.GetParent(); Assert.AreEqual(viewModel, parent); }
public void PackageViewModels_ChildPackageViewModelParent_IsUpdatedPackagesViewModel() { CreateViewModel(); AddPackageToLocalRepository("Test", "1.0.0.0"); FakePackage newerPackage = AddPackageToActiveRepository("Test", "1.1.0.0"); viewModel.ReadPackages(); CompleteReadPackagesTask(); PackageViewModel childViewModel = viewModel.PackageViewModels.First(); IPackageViewModelParent parent = childViewModel.GetParent(); Assert.AreEqual(viewModel, parent); }
public void PackageViewModels_GetParentOfPackageViewModel_ReturnsAvailablePackagesViewModel() { CreateViewModel(); var package1 = new FakePackage("Test", "0.1.0.0"); var package2 = new FakePackage("Test", "0.2.0.0"); var packages = new FakePackage[] { package1, package2 }; registeredPackageRepositories.FakeActiveRepository.FakePackages.AddRange(packages); viewModel.ReadPackages(); CompleteReadPackagesTask(); PackageViewModel childViewModel = viewModel.PackageViewModels.First(); IPackageViewModelParent parent = childViewModel.GetParent(); Assert.AreEqual(viewModel, parent); }