Example #1
0
        public void MovieMeterService_GivenProviderInCtor_ShouldBeStoredAsProperty()
        {
            var service = new MovieMeterService(_repository, _programProvider);

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

            var updates = await service.GetAllUpdates();

            Assert.IsTrue(_repository.GetAllUpdatesCalled);
        }
Example #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);
        }
Example #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);
        }
Example #5
0
 public void MovieMeterService_GivenNullProgramProviderInCtor_ShouldThrowArgumentNullException()
 {
     var service = new MovieMeterService(_repository, null);
 }
Example #6
0
 public void MovieMeterService_GivenNullRepositoryInCtor_ShouldThrowArgumentNullException()
 {
     var service = new MovieMeterService(null, _programProvider);
 }