public void MovieMeterService_GivenProviderInCtor_ShouldBeStoredAsProperty() { var service = new MovieMeterService(_repository, _programProvider); Assert.AreSame(_programProvider, service.ProgramProvider); Assert.IsNotNull(service.ProgramProvider); }
public async Task MovieMeterService_WhenGetAllUpdates_ShouldGetAllUpdatesFromRepository() { var service = new MovieMeterService(_repository, _programProvider); var updates = await service.GetAllUpdates(); Assert.IsTrue(_repository.GetAllUpdatesCalled); }
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); }
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); }
public void MovieMeterService_GivenNullProgramProviderInCtor_ShouldThrowArgumentNullException() { var service = new MovieMeterService(_repository, null); }
public void MovieMeterService_GivenNullRepositoryInCtor_ShouldThrowArgumentNullException() { var service = new MovieMeterService(null, _programProvider); }