Esempio n. 1
0
        public void MovieMeterService_GivenProviderInCtor_ShouldBeStoredAsProperty()
        {
            var service = new MovieMeterService(_repository, _programProvider);

            Assert.AreSame(_programProvider, service.ProgramProvider);
            Assert.IsNotNull(service.ProgramProvider);
        }
Esempio n. 2
0
        public async Task MovieMeterService_WhenGetAllUpdates_ShouldGetAllUpdatesFromRepository()
        {
            var service = new MovieMeterService(_repository, _programProvider);

            var updates = await service.GetAllUpdates();

            Assert.IsTrue(_repository.GetAllUpdatesCalled);
        }
Esempio n. 3
0
        public async Task MovieMeterService_WhenGetAllPrograms_ShouldCallRepository()
        {
            var query   = new ProgramQuery();
            var service = new MovieMeterService(_repository, _programProvider);

            var programs = await service.GetAllPrograms(query, 25);

            Assert.IsTrue(_repository.GetAllProgramsCalled);
        }
Esempio n. 4
0
        public async Task MovieMeterService_WhenGetLatestUpdate_ShouldRequestLatestUpdateFromRepositoryForSameSourceId()
        {
            var service  = new MovieMeterService(_repository, _programProvider);
            var sourceId = Guid.NewGuid().ToString();

            var latestUpdate = await service.GetLatestUpdateForSource(sourceId);

            Assert.IsTrue(_repository.GetLatestUpdateCalled);
            Assert.AreEqual(sourceId, _repository.GetLatestUpdateSourceId);
        }
Esempio n. 5
0
 public void MovieMeterService_GivenNullProgramProviderInCtor_ShouldThrowArgumentNullException()
 {
     var service = new MovieMeterService(_repository, null);
 }
Esempio n. 6
0
 public void MovieMeterService_GivenNullRepositoryInCtor_ShouldThrowArgumentNullException()
 {
     var service = new MovieMeterService(null, _programProvider);
 }