Example #1
0
        public void GetDataPointsTest()
        {
            DataPoint[] result;

            try
            {
                result = _dataset.GetDataPoints(spectrumIdx: 0, valueIdxFrom: 3, valueIdxTo: 0);
                Assert.Fail(message: "Dataset accepted incorrect indices.");
            }
            catch (Exception) { }

            try
            {
                result = _dataset.GetDataPoints(spectrumIdx: 0, valueIdxFrom: 0, valueIdxTo: 4);
                Assert.Fail(message: "Dataset accepted incorrect indices.");
            }
            catch (Exception) { }

            result = _dataset.GetDataPoints(spectrumIdx: 0, valueIdxFrom: 0, valueIdxTo: 3);

            Assert.AreEqual(result[2]
                            .Mz,
                            _dataset.GetDataPoint(spectrumIdx: 0, valueIdx: 2)
                            .Mz,
                            message: "Dataset returned wrong m/z values.");
            Assert.AreEqual(result[2]
                            .Intensity,
                            _dataset.GetDataPoint(spectrumIdx: 0, valueIdx: 2)
                            .Intensity,
                            message: "Dataset returned wrong intensity values.");
        }