コード例 #1
0
        public void GenerateBigTestData()
        {
            var sut = new DataPrepper(HelperFunctions.GenerateBigPureData(),
                                      new StockInputsGeneratorFactory(InputsType.Full),
                                      new StockTargetsGeneratorFactory(TargetType.Profit, 50));

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

            Approvals.VerifyAll(trainingData, "DataSet", a => string.Join(",", a.Targets) + " and " + string.Join(", ", a.SourceData));
        }
コード例 #2
0
        public void PuttingItAllTogetherForTestData()
        {
            var sut = new DataPrepper(HelperFunctions.GeneratePureData(),
                                      new StockInputsGeneratorFactory(InputsType.Basic, 3),
                                      new StockTargetsGeneratorFactory(TargetType.Profit, 2));

            sut.GetTrainingInputData();

            IList <DataSet> unTargeted = sut.UnTargeted;

            Approvals.VerifyAll(unTargeted, "DataSet", a =>
                                $" targets {string.Join(", ", a.Targets)} inputs {string.Join(", ", a.SourceData)}");
        }
コード例 #3
0
        public void ReverseWordTraditional()
        {
            var names        = new[] { "carlos", "perez" };
            var reverser     = new WordReverser();
            var reverseNames = reverser.Reverse(names).ToArray();

            //Assert.AreEqual("solrac", reverseNames[0]);
            //Assert.AreEqual("zerep", reverseNames[1]);

            //you can also add headers like so
            //Approvals.VerifyAll("header", reverseNames, x => string.Format("{0}", x));

            Approvals.VerifyAll(reverseNames, "Name", x => x.PadLeft(10));
        }
コード例 #4
0
        public void TestMethod1()
        {
            var numbers = Enumerable.Range(1, 6);//.Concat(new []{20});

            Approvals.VerifyAll(numbers, i => "{0} => {1}".FormatWith(i, SmallestMultiple(i)).Log("", n => "" + n));

            /*
             * generalize both inputs
             * maximumDivisor (20) -> {1..20}
             * result ->{all results}
             *
             * given d
             * for all di such that 1 < di < d
             * smallest r such that  r % di =0
             * 4
             *   {1..d}!
             *   1 * 2 * 3 * 4
             *   1 * 2 * 3 * (2 * 2)
             *   remove any value such that {1..d} / value is still true.
             *   any
             *   1 * (1)
             *   {1..{pf(d)}!
             *
             * r such that r is smallest & divisable by all {1..d}
             * r => product of prime factors
             * pf(r) and remove 1 form the set   pf(r-1)<  pf(r)
             * pf(r-1) must not by divisable by all {1..d}
             *
             *
             * {2,2,5,7,7,3,10} this is divisable by all {1..d}
             * {2,2,5,7,3,10} this is divisable then it smaller.
             * there the shortest list that can't shrink is the smaller number.
             *
             *  {1}
             *  smallest
             *
             *  {2,3} smallest
             *  2 * {3}  where list is still valid
             *  3 * {2}
             *
             *  {2} * {2}
             *  {2} * {2,5,7,7,3,10}  =  smallest disisable
             *  then niether side is disivable
             *
             *
             *
             * */
        }
コード例 #5
0
 public void TestBigPureData()
 {
     Approvals.VerifyAll(HelperFunctions.GenerateBigPureData().GetData(),
                         "Element",
                         e => $" {e.Key.Date} values {string.Join(", ", e.Values)}");
 }