Exemple #1
0
        public void TestChorusInstrumentModels()
        {
            var accounts = new[]
            {
                new ChorusAccount("https://chorusproject.org", "*****@*****.**", "pwd"),
            };
            ChorusSession chorusSession    = new ChorusSession();
            var           instrumentModels = new HashSet <string>();

            foreach (var account in accounts)
            {
                ChorusContents chorusContents = chorusSession.FetchContents(account, new Uri(account.ServerUrl + "/skyline/api/contents/my/files"));
                Assert.IsNotNull(chorusContents);
                foreach (var file in ListAllFiles(chorusContents))
                {
                    instrumentModels.Add(file.instrumentModel);
                }
            }
            Assert.AreNotEqual(0, instrumentModels.Count);
            var unknownInstrumentModels = new List <string>();

            foreach (var instrumentModel in instrumentModels)
            {
                if (null == ChorusSession.GetFileTypeFromInstrumentModel(instrumentModel))
                {
                    unknownInstrumentModels.Add(instrumentModel);
                }
            }
            Assert.AreEqual(0, unknownInstrumentModels.Count, "Unknown instrument models {0}", string.Join(",", unknownInstrumentModels));
        }
Exemple #2
0
        public void TestChorusContents()
        {
            ChorusSession  chorusSession  = new ChorusSession();
            ChorusContents chorusContents = chorusSession.FetchContents(TEST_ACCOUNT, new Uri(TEST_ACCOUNT.ServerUrl + "/skyline/api/contents/my/projects"));

            Assert.IsNotNull(chorusContents);
        }
Exemple #3
0
 IEnumerable <ChorusContents.File> ListAllFiles(ChorusContents chorusContents)
 {
     return(SafeList(chorusContents.myFiles)
            .Concat(SafeList(chorusContents.myExperiments).SelectMany(ListAllFiles))
            .Concat(SafeList(chorusContents.myProjects).SelectMany(ListAllFiles))
            .Concat(SafeList(chorusContents.sharedFiles))
            .Concat(SafeList(chorusContents.sharedExperiments).SelectMany(ListAllFiles))
            .Concat(SafeList(chorusContents.sharedProjects).SelectMany(ListAllFiles))
            .Concat(SafeList(chorusContents.publicFiles)
                    .Concat(SafeList(chorusContents.publicExperiments).SelectMany(ListAllFiles))
                    .Concat(SafeList(chorusContents.publicProjects).SelectMany(ListAllFiles)))
            .Concat(SafeList(chorusContents.files)));
 }