Example #1
0
        public async Task ResolveCorpus()
        {
            Assert.IsTrue(Directory.Exists(Path.GetFullPath(SchemaDocsRoot)), "SchemaDocsRoot not found!!!");

            var cdmCorpus = new CdmCorpusDefinition();

            cdmCorpus.SetEventCallback(new EventCallback {
                Invoke = CommonDataModelLoader.ConsoleStatusReport
            }, CdmStatusLevel.Warning);

            Console.WriteLine("reading source files");

            var watch = Stopwatch.StartNew();

            cdmCorpus.Storage.Mount("local", new LocalAdapter(SchemaDocsRoot));
            var manifest = await cdmCorpus.FetchObjectAsync <CdmManifestDefinition>(TestHelper.CdmStandardSchemaPath);

            var directives = new AttributeResolutionDirectiveSet(new HashSet <string> {
                "normalized", "referenceOnly"
            });
            await EntityResolutionTests.ListAllResolved(cdmCorpus, directives, manifest);

            watch.Stop();
            Assert.Performance(70000, watch.ElapsedMilliseconds);
        }
Example #2
0
        public void TestEntityTimeDateReadInLocalFormat()
        {
            var originalModelJson = TestHelper.GetInputFileContent(testsSubpath, "TestEntityTimeDateReadInLocalFormat", "SerializerTesting-entity2.json");
            var deserialized      = Deserialize <Entity>(originalModelJson);

            var expectedSerializedLastChildFileModifiedTime = "\"2018-12-19T02:05:03.2374986+00:00\"";
            var expectedSerializedLastFileModifiedTime      = "\"2018-12-19T05:05:03.2374986+00:00\"";
            var expectedSerializedLastFileStatusCheckTime   = "\"2018-12-19T21:35:03.2374986+00:00\"";

            var lastChildFileModifiedTime = deserialized?.LastChildFileModifiedTime;
            var lastFileModifiedTime      = deserialized?.LastFileModifiedTime;
            var lastFileStatusCheckTime   = deserialized?.LastFileStatusCheckTime;

            Assert.AreEqual(expectedSerializedLastChildFileModifiedTime, Serialize(lastChildFileModifiedTime));
            Assert.AreEqual(expectedSerializedLastFileModifiedTime, Serialize(lastFileModifiedTime));
            Assert.AreEqual(expectedSerializedLastFileStatusCheckTime, Serialize(lastFileStatusCheckTime));


            string serialized = Serialize(deserialized);

            Assert.IsTrue(serialized.Contains(expectedSerializedLastChildFileModifiedTime));
            Assert.IsTrue(serialized.Contains(expectedSerializedLastFileModifiedTime));
            Assert.IsTrue(serialized.Contains(expectedSerializedLastFileStatusCheckTime));
        }