Beispiel #1
0
        public async Task it_registers_formatters()
        {
            using var kernel = new CompositeKernel();

            var kernelExtension = new DataFrameKernelExtension();

            await kernelExtension.OnLoadAsync(kernel);

            var stream = @"id,name,color,deliciousness
1,apple,green,10
2,banana,yellow,11
3,cherry,red,9000".ToStream();

            var dataFrame = DataFrame.LoadCsv(stream);

            var formatted = dataFrame.ToDisplayString(TabularDataResourceFormatter.MimeType);

            this.Assent(formatted, _configuration);
        }
Beispiel #2
0
        public async Task it_registers_formatters()
        {
            using var kernel = new CompositeKernel();

            var kernelExtension = new DataFrameKernelExtension();

            await kernelExtension.OnLoadAsync(kernel);

            using var stream = new MemoryStream();
            using var writer = new StreamWriter(stream);
            writer.AutoFlush = true;
            writer.Write(@"id,name,color,deliciousness
1,apple,green,10
2,banana,yellow,11
3,cherry,red,9000");
            stream.Position = 0;

            var dataframe = DataFrame.LoadCsv(stream);

            var formatted = dataframe.ToDisplayString(TabularDataFormatter.MimeType);

            this.Assent(formatted, _configuration);
        }