コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: thedanny/pcr-well
        public async Task ShouldConvert()
        {
            var logger     = _server.Services.GetService <ILogger <PcrConverter> >();
            var pcrSetting = _server.Services.GetService <IOptions <PcrSetting> >();

            var converter  = new PcrConverter(pcrSetting.Value, logger);
            var sourcePath = @"C:\Data\Pcr-samples\inputFile.csv";
            await converter.ConvertAsync(sourcePath);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: thedanny/pcr-well
        public void GetAllWellAddressShouldReturn96Rows()
        {
            var pcrSetting = _server.Services.GetService <IOptions <PcrSetting> >().Value;
            var logger     = _server.Services.GetService <ILogger <PcrConverter> >();

            var converter = new PcrConverter(pcrSetting, logger);
            var wells     = converter.GetAllWellAddresses();

            Console.WriteLine(string.Join("\n", wells.Select(a => a.ToString())));
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: thedanny/pcr-well
        public void ExportPcrWellFormatToStream_shouldExport()
        {
            var pcrSetting = _server.Services.GetService <IOptions <PcrSetting> >();

            var sourcePath = @"C:\Data\Pcr-samples\inputFile.csv";
            var logger     = _server.Services.GetService <ILogger <PcrConverter> >();



            using (var source = File.OpenRead(sourcePath))
            {
                var converter = new PcrConverter(pcrSetting.Value, logger);

                var tmp = sourcePath + "_converted.csv";

                using (var sw = new StreamWriter(tmp))
                {
                    converter.ExportPcrWellFormatToStream(source, sw);
                }

                Console.WriteLine(File.ReadAllText(tmp));
            }
            Assert.Pass();
        }