Exemple #1
0
        public void TryToReadDataRecordsFromFileWorksForValidFiles()
        {
            var targetAlgorithmFactory =
                new TargetAlgorithmFactoryTest.DummyTargetAlgorithmFactory <
                    TargetAlgorithmFactoryTest.DummyTargetAlgorithm <TestInstance, RuntimeResult>, TestInstance, RuntimeResult>();

            GrayBoxUtils.TryToReadDataRecordsFromFile(targetAlgorithmFactory, GrayBoxUtilsTest.ValidDataLogFile, out var dataRecords).ShouldBeTrue();

            // Check count.
            dataRecords.Count.ShouldBe(1);

            // Check all values.
            GrayBoxUtilsTest.CheckDataRecordValues(dataRecords[0]);
        }
Exemple #2
0
        public void TryToReadDataRecordsFromDirectoryReturnsCorrectOutput()
        {
            var targetAlgorithmFactory =
                new TargetAlgorithmFactoryTest.DummyTargetAlgorithmFactory <
                    TargetAlgorithmFactoryTest.DummyTargetAlgorithm <TestInstance, RuntimeResult>, TestInstance, RuntimeResult>();

            GrayBoxUtils.TryToReadDataRecordsFromDirectory(
                targetAlgorithmFactory,
                GrayBoxUtilsTest.PathToRealTestDataDirectory,
                0,
                1,
                out var dataRecords)
            .ShouldBeTrue();

            // Check count.
            dataRecords.Count.ShouldBe(2);

            // Check all values.
            foreach (var dataRecord in dataRecords)
            {
                GrayBoxUtilsTest.CheckDataRecordValues(dataRecord);
            }
        }