Ejemplo n.º 1
0
        public static void Test_Compare_02()
        {
            string file1      = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\FindPrint_out_bson.txt";
            string file2      = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\_archive\FindPrint_v1_SelectPost_02\FindPrint_out_bson.txt";
            string resultFile = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\test_compare.txt";

            BsonDocumentComparator.CompareBsonDocumentFilesWithKey(file1, file2, "post_title", "post_title", joinType: pb.Linq.JoinType.InnerJoin,
                                                                   // "remainText", "warnings"
                                                                   //elementsToCompare: new string[] { "category", "file", "print", "title" }).zSaveToJsonFile(resultFile);
                                                                   elementsToCompare: new string[] { "findPrint_file" }, comparatorOptions: BsonDocumentComparatorOptions.ReturnNotEqualDocuments)
            //.zSaveToJsonFile(resultFile);
            .Select(result => result.GetResultDocument()).zSave(resultFile);
            RunSource.CurrentRunSource.SetResult(zMongo.BsonRead <BsonDocument>(resultFile)
                                                 //.Where(doc => !(doc["result"]["findPrint_file"]["value1"] is BsonNull) && doc["result"]["result"].AsString != "equal")
                                                 .Where(doc => !(doc["result"]["findPrint_file"]["value1"] is BsonNull))
                                                 .Select(doc => new BsonDocument {
                { "result", doc["result"] }
            }).zToDataTable2_old());
        }
Ejemplo n.º 2
0
 public static void Test_Compare(string file1, string file2, string resultFile, IEnumerable <string> elementsToCompare = null, BsonDocumentComparatorOptions options = BsonDocumentComparatorOptions.ReturnNotEqualDocuments)
 {
     //string file1 = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\FindPrint_out_bson.txt";
     //string file2 = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\_archive\FindPrint_v1_SelectPost_02\FindPrint_out_bson.txt";
     //string resultFile = @"c:\pib\dev_data\exe\runsource\test_unit\Print\FindPrint\test_compare.txt";
     file1 = zPath.Combine(GetDirectory(), file1);
     file2 = zPath.Combine(GetDirectory(), file2);
     if (elementsToCompare == null)
     {
         elementsToCompare = new string[] { "findPrint_file" }
     }
     ;
     resultFile = zPath.Combine(GetDirectory(), resultFile);
     BsonDocumentComparator.CompareBsonDocumentFilesWithKey(file1, file2, "post_title", "post_title", joinType: pb.Linq.JoinType.InnerJoin, elementsToCompare: elementsToCompare, comparatorOptions: options)
     .Select(result => result.GetResultDocument()).zSave(resultFile);
     RunSource.CurrentRunSource.SetResult(zmongo.FileReader <BsonDocument>(resultFile)
                                          .Select(doc => new BsonDocument {
         { "result", doc["result"] }
     }).zToDataTable2_old());
 }
Ejemplo n.º 3
0
 // Func<BsonDocument, BsonDocument, BsonDocument> resultSelector = null
 public static void Test_Compare_01(string file1, string file2, string key1, string key2, string resultFile, JoinType joinType = JoinType.InnerJoin)
 {
     // .zSaveToJsonFile(resultFile);
     BsonDocumentComparator.CompareBsonDocumentFilesWithKey(file1, file2, key1, key2, joinType).Select(result => result.GetResultDocument()).zSave(resultFile);
 }