public void GetDownloadHistoryRepository_RetrieveTestAndActualRepos_SuccessfulRetrieval()
    {
        downloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(false);
        Assert.NotNull(downloadHistoryRepo);
        Assert.AreEqual(downloadHistoryRepo.GetType().Name, "DownloadHistoryRepository");

        downloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(true);
        Assert.NotNull(downloadHistoryRepo);
        Assert.AreEqual(downloadHistoryRepo.GetType().Name, "TestDownloadHistoryRepository");
    }
Example #2
0
 public DownloadHistoryService(IDownloadHistoryRepository repository, IHistoryService historyService)
 {
     _repository     = repository;
     _historyService = historyService;
 }
    public void Setup()
    {
        repositoryFactory = new RepositoryFactory(configString);
        Assert.NotNull(repositoryFactory);

        userRepo = repositoryFactory.GetUserRepository(false);
        Assert.NotNull(userRepo);

        fileRepo = repositoryFactory.GetFileRepository(false); //Need to use the existing DataContext for this test already setup in UserRepository
        Assert.NotNull(fileRepo);

        downloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(false); //Need to use the existing DataContext for this test already setup in UserRepository
        Assert.NotNull(downloadHistoryRepo);

        mockDownloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(true); //This returns a test repo that doesn't hit the database
        Assert.NotNull(mockDownloadHistoryRepo);
    }