Beispiel #1
0
        public void TestDbAutoCreate()
        {
            var fitsCreator = new FitsFileInfoService();
            var file        = TestUtils.GenerateRandomFileName();

            _perTestDeletables.Add(file);
            using (var newFitsDb = new FitsDatabase(fitsCreator, null, file, true));
            Assert.AreEqual(true, File.Exists(file));
        }
Beispiel #2
0
        public async Task TestIndexingAnExistingFitsFileInDb()
        {
            var fitsCreator = new FitsFileInfoService();
            var file        = TestUtils.GenerateRandomFileName();

            _perTestDeletables.Add(file);
            using (var newFitsDb = new FitsDatabase(fitsCreator, null, file, true))
            {
                var fitsFilePath = Path.Combine(TestUtils.GetTestPath(), "Resources", "FitsFiles", "Light_001.fits");
                await newFitsDb.AddFiles(new[] { fitsFilePath, fitsFilePath });

                Assert.AreEqual(1, newFitsDb.FileCount);
            }
        }
Beispiel #3
0
        public async Task TestStuff()
        {
            var fitsCreator = new FitsFileInfoService();
            var file        = TestUtils.GenerateRandomFileName();

            _perTestDeletables.Add(file);
            using (var newFitsDb = new FitsDatabase(fitsCreator, null, file, true))
            {
                var fitsFilePath = Path.Combine(TestUtils.GetTestPath(), "Resources", "FitsFiles", "Light_001.fits");
                await newFitsDb.AddFiles(new[] { fitsFilePath });

                // var queryable = newFitsDb.FileListAsQueryable();
                var builder = new FitsQueryBuilder();
                var q       = builder.KeywordSearch("TELESCOP", "NexStar");
                var q2      = builder.RaDecRadius(36.801, 33.3, 60);
                var fcount  = newFitsDb.RunQuery(new [] { q, q2 });
                Assert.AreEqual(1, fcount);
            }
        }