Пример #1
0
        public static void WriteSyncTest(DBData outputDat, string outputFileName)
        {
            var writer = new DBDataFileWriter(outputFileName);

            var isSuccess    = false;
            var errorMessage = "";

            try
            {
                writer.WriteSync(outputDat);
                isSuccess = true;
            }
            catch (Exception e)
            {
                errorMessage = e.Message;
            }

            // 出力成功すること
            if (!isSuccess)
            {
                throw new InvalidOperationException(
                          $"Error message: {errorMessage}");
            }

            Assert.True(true);
        }
Пример #2
0
        public static void DBDataIOTest(string inputFileName, string outputFileName)
        {
            var reader =
                new DBDataFileReader(
                    $@"{DBDataFileTestItemGenerator.TestWorkRootDir}\{inputFileName}");
            var    isSuccessRead = false;
            DBData data          = null;

            try
            {
                data          = reader.ReadAsync().GetAwaiter().GetResult();
                isSuccessRead = true;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
            }

            Assert.IsTrue(isSuccessRead);

            var writer = new DBDataFileWriter(
                $@"{DBDataFileTestItemGenerator.TestWorkRootDir}\{outputFileName}");
            var isSuccessWrite = false;

            try
            {
                writer.WriteAsync(data).GetAwaiter().GetResult();
                isSuccessWrite = true;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
            }

            Assert.IsTrue(isSuccessWrite);

            Console.WriteLine(
                $@"Written FilePath : {DBDataFileTestItemGenerator.TestWorkRootDir}\{outputFileName}");
        }