public void TestAllCubeDistance() { BookitDB db = new BookitDB(); var allCubes = db.Cubes; IMapRepository mapRep = new MapDBRepository(); DijikstraPathFinder sfinder = new DijikstraPathFinder(mapRep.Map); var allRooms = db.MeetingRooms.Select(mr => mr as MapNode).ToList(); using (var fs = File.Open(@"C:\result.txt", FileMode.OpenOrCreate)) { using (var sw = new StreamWriter(fs)) { sw.Write(string.Format("CUBE,")); foreach (var mr in allRooms) sw.Write(mr.Name + ","); sw.WriteLine(); foreach (var cube in allCubes) { var island = mapRep.GetIsland(cube.Name); var nodeWithDistance = sfinder.GetDistance(island, allRooms); sw.Write(cube.Name + ","); foreach (var mr in allRooms) { sw.Write(nodeWithDistance[mr] + ","); } sw.WriteLine(); } } } }
public void CubesTest() { BookitDB db = new BookitDB(); var island = db.MapNodes .Where(n => n is CubeIsland) .Select(n => n as CubeIsland).Include(p => p.Cubes); foreach (var i in island) { Assert.IsNotNull(i.Cubes); } }
public void Init() { if (!initilized) { Log.Info("begin initialising cache..."); this.rdoSession = new RDOSession(); rdoSession.Logon(); BookitDB db = new BookitDB(); this.emails = db.MeetingRooms.Select(mr => mr.Email).ToList(); poolingThread = new Thread(PullingWorker); poolingThread.IsBackground = true; poolingThread.Start(); initilized = true; Log.Info("cache initialized"); } }