Пример #1
0
        public void RecentPackageRepository_NoRecentPackages_ReturnsRecentRepositoryCreatedByFactory()
        {
            CreateCache();
            IRecentPackageRepository    repository         = cache.RecentPackageRepository;
            FakeRecentPackageRepository expectedRepository = fakePackageRepositoryFactory.FakeRecentPackageRepository;

            Assert.AreEqual(expectedRepository, repository);
        }
        public void RecentPackageRepository_PropertyAccessed_ReturnsRecentPackageRepositoryFromCache()
        {
            CreateRegisteredPackageRepositories();
            IRecentPackageRepository    recentRepository   = registeredRepositories.RecentPackageRepository;
            FakeRecentPackageRepository expectedRepository = fakeRepositoryCache.FakeRecentPackageRepository;

            Assert.AreEqual(expectedRepository, recentRepository);
        }
Пример #3
0
        public void CreateRecentPackageRepository_AggregateRepositoryPassedAndNoRecentPackagesPassed_UsesFactoryToCreateRepository()
        {
            CreateCache();
            IPackageRepository repository = CreateRecentPackageRepositoryPassingAggregateRepository();

            FakeRecentPackageRepository expectedRepository = fakePackageRepositoryFactory.FakeRecentPackageRepository;

            Assert.AreEqual(expectedRepository, repository);
        }
        void CreateViewModel(FakeRegisteredPackageRepositories registeredPackageRepositories)
        {
            taskFactory = new FakeTaskFactory();
            var packageViewModelFactory = new FakePackageViewModelFactory();

            recentPackageRepository = new FakeRecentPackageRepository();

            viewModel = new AvailablePackagesViewModel(
                registeredPackageRepositories,
                recentPackageRepository,
                packageViewModelFactory,
                taskFactory);
        }
        AvailablePackagesViewModel CreateViewModelParent()
        {
            var taskFactory = new FakeTaskFactory();
            var registeredPackageRepositories = new FakeRegisteredPackageRepositories();
            var packageViewModelFactory       = new FakePackageViewModelFactory();
            var recentPackageRepository       = new FakeRecentPackageRepository();

            return(new AvailablePackagesViewModel(
                       registeredPackageRepositories,
                       recentPackageRepository,
                       packageViewModelFactory,
                       taskFactory));
        }
 void CreateRecentRepository()
 {
     fakeRecentRepository = new FakeRecentPackageRepository();
 }