public FacultiesProvider(INpuServerFetcher fetcher)
        {
            _fetcher = fetcher;

            PeriodicCallIntervalInSeconds = _cacheLifeTimeInMinutes * 60;
            PeriodicAction = UpdateCache;
        }
Пример #2
0
        static StubNpuServerFetcher()
        {
            var mock = new Mock <INpuServerFetcher>();

            mock.Setup(f => f.FetchCalendar())
            .ReturnsAsync(ReadCalendar);
            var faculty = "fi";

            mock.Setup(f => f.FetchClassroom(It.Is <string>(s => s == faculty)))
            .ReturnsAsync(ReadClassrooms);
            mock.Setup(f => f.FetchFaculties())
            .ReturnsAsync(ReadFaculties);
            mock.Setup(f => f.FetchGroups(It.Is <string>(s => s == faculty)))
            .ReturnsAsync(ReadGroups);
            mock.Setup(f => f.FetchLecturers(It.Is <string>(s => s == faculty)))
            .ReturnsAsync(ReadLecturers);
            mock.Setup(f => f.FetchSettings())
            .ReturnsAsync(ReadSettings);
            Fetcher = mock.Object;
        }
 public CalendarRawItemHolder(INpuServerFetcher fetcher)
 {
     _fetcher = fetcher;
     PeriodicCallIntervalInSeconds = _cacheLifeTimeMinutes * 60;
     PeriodicAction = UpdateCache;
 }
Пример #4
0
 public ClassroomHolder(INpuServerFetcher fetcher)
 {
     _fetcher = fetcher;
     PeriodicCallIntervalInSeconds = _cacheLifetimeInMinutes * 60;
     PeriodicAction = ClearCache;
 }