Esempio n. 1
0
        public void EnumDescDataStoreSaveToCsv()
        {
            IEnumDescRepository saveData = new EnumDescSaveToCsv();

            ((EnumDescSaveToCsv)saveData).FileName = @".\EnumFileSaveTest.csv";

            saveData.SaveDataEnumDescSetAsync(edc).Wait();
            Assert.IsTrue(true);
        }
Esempio n. 2
0
        public void EnumServiceLoadCsvToDB()
        {
            string fileName = "EnumServiceLoadCSVTest.csv";

            if (File.Exists($"Complete-{fileName}"))
            {
                System.IO.File.Move($"Complete-{fileName}", fileName);
            }
            else if (!File.Exists(fileName))
            {
                EnumDescSaveToCsv csv = new EnumDescSaveToCsv();
                csv.FileName = fileName;
                csv.SaveDataEnumDescSetAsync(_edc).Wait();
            }
            _es.SetupLoadFileToDBAsync(fileName).Wait();
            Assert.IsTrue(File.Exists($"Complete-{fileName}"));
        }
Esempio n. 3
0
        public void EnumDescDataStoreGetFromCsv()
        {
            IEnumDescRepository saveData = new EnumDescSaveToCsv();

            ((EnumDescSaveToCsv)saveData).FileName = @".\EnumFileGetTest.csv";
            saveData.SaveDataEnumDescSetAsync(edc).Wait();

            EnumDescCollection edc2 = saveData.GetDataEnumDescSetAsync().Result;

            Assert.IsTrue(edc2.Count == edc.Count);
            bool pass = true;

            foreach (EnumDescDataStoreModel enumDesc in edc2)
            {
                if (!edc.Exists(x => x.SetId == enumDesc.SetId && x.MemberId == enumDesc.MemberId))
                {
                    pass = false;
                }
            }
            Assert.IsTrue(pass);
        }