Exemplo n.º 1
0
        private IEnumerable <ProteinLoadInfo> Load()
        {
            IEnumerable <ProteinLoadInfo> loadInfo = _dictionary.Load(_downloader.FilePath).ToList();

            foreach (var info in loadInfo.Where(info => info.Result != ProteinLoadResult.NoChange))
            {
                Logger.Info(info.ToString());
            }
            Write();
            return(loadInfo);
        }
Exemplo n.º 2
0
        public void LoadTest1()
        {
            // build the collection of proteins to load
            var values = new List <Protein>();

            values.Add(CreateValidProtein(1));
            values.Add(CreateValidProtein(2));
            values.Add(new Protein {
                ProjectNumber = 3
            });

            // execute load
            var results = _dictionary.Load(values).ToList();

            // check the results
            Assert.AreEqual(2, results.Count);
            Assert.AreEqual(1, results[0].ProjectNumber);
            Assert.AreEqual(ProteinLoadResult.Added, results[0].Result);
            Assert.IsNull(results[0].Changes);
            Assert.AreEqual(2, results[1].ProjectNumber);
            Assert.AreEqual(ProteinLoadResult.Added, results[1].Result);
            Assert.IsNull(results[1].Changes);
        }