Пример #1
0
        public void InitalCall()
        {
            PureData pureData = new PureData(new List <DataElement>());
            IInputsGeneratorFactory  inputsFactory  = A.Fake <IInputsGeneratorFactory>();
            ITargetsGeneratorFactory targetsFactory = A.Fake <ITargetsGeneratorFactory>();

            A.CallTo(() => inputsFactory.GetInputGenerators(pureData)).Returns(Enumerable.Empty <IInputGenerator>());
            A.CallTo(() => targetsFactory.GetTargetGenerators(pureData)).Returns(Enumerable.Empty <ITargetGenerator>());

            var sut = new DataPrepper(pureData, inputsFactory, targetsFactory);

            IList <DataSet> trainingData = sut.GetTrainingInputData();

            Assert.NotNull(trainingData);
            A.CallTo(() => inputsFactory.GetInputGenerators(pureData)).MustHaveHappened();
            A.CallTo(() => targetsFactory.GetTargetGenerators(pureData)).MustHaveHappened();
        }
Пример #2
0
        private void CalculateTargets()
        {
            IEnumerable <ITargetGenerator> generators = _tgf.GetTargetGenerators(_pureData);

            _targets = new List <IList <DataElement> >();

            foreach (var generator in generators)
            {
                _targets.Add(generator.CreateData().ToArray());
            }
        }