Пример #1
0
        public void Remove_BasicTest(ITimetable timetable)
        {
            timetable.AddOrUpdate("a", 100);
            timetable.AddOrUpdate("b", 50);
            timetable.Remove("a");

            var items = timetable.GetTimetable();

            items.Count.Should().Be(1);
            items[0].RouteId.Should().Be("b");
            items[0].MsBeforeArrival.Should().Be(50);
        }
Пример #2
0
 //todo this method should be optimized using:
 // - https://dotnet.github.io/orleans/Documentation/grains/stateless_worker_grains.html
 // - https://github.com/dotnet/orleans/issues/5283#issuecomment-450977696
 // - https://github.com/dotnet/orleans/issues/3841
 // - https://stackoverflow.com/questions/48145496/msr-orleans-how-to-create-a-reader-writer-grain-with-parallel-reads/48146722#48146722
 public Task <IReadOnlyList <TimeTableItem> > GetTimetable()
 {
     return(Task.FromResult(_timetable.GetTimetable()));
 }