コード例 #1
0
        public void LoadDataStreaming_FakeCSVParameterSource_ReturnsStubCSV()
        {
            //Arrange
            DataStreaming dataStreaming = new DataStreaming(parameterSource);

            //Assert
            string filePath   = Directory.GetParent("../../../../") + @"/BatteryDataStream/Data/Parameters.csv";
            string parameters = dataStreaming.Load(filePath);

            //Assert
            Assert.True(IsFloat(parameters, 1));
        }
コード例 #2
0
        static void Main(string[] args)
        {
            _csvParameterSource = new CSVParameterSource();
            _batteryDataStream  = new DataStreaming(_csvParameterSource);
            _batteryDataStream.Load(_filePath);
            if (args.Length > 0 && int.TryParse(args[0], out int result))
            {
                _limitRows = result;
            }

            Console.WriteLine("Streaming is started in csv format(stateofcharge,temperature). Press Ctrl+C to end");
            Console.CancelKeyPress += (sender, eventArgs) =>
            {
                Console.WriteLine("Streaming stop event is triggered");
                cancellationToken.Cancel();
                eventArgs.Cancel = true;
            };

            StartStreaming();
        }