Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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())));
        }
Exemplo n.º 3
0
        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();
        }