Пример #1
0
        void RunTestsButton_Click(object sender, EventArgs e)
        {
            using (var stream = new FileStream(PathBox.Text, FileMode.Open))
            {
                var singleBitTest = new SingleBitTest();
                singleBitTest.Run(stream);
                SingleBitOnesLabel.Text = singleBitTest.Ones.ToString();
                SingleBitPassedLabel.Text = singleBitTest.Passed ? "Passed" : "Failed";

                stream.Position = 0;
                var pokerTest = new PokerTest();
                pokerTest.Run(stream);
                PokerPassedLabel.Text = pokerTest.Passed ? "Passed" : "Failed";
                PValueLabel.Text = pokerTest.P.ToString();

                stream.Position = 0;
                var blockGapTest = new BlockGapTest();
                blockGapTest.Run(stream);
                BlockStatistic.Text = blockGapTest.Statistic.ToString();

                stream.Position = 0;
                var autoCorrelationTest = new AutocorrelationTest((int) ShiftBox.Value);
                autoCorrelationTest.Run(stream);
                AutocorrelationStatisticLabel.Text = autoCorrelationTest.Statistic.ToString();
            }
        }