Пример #1
0
        public static void CompareVisualTrees(DeployFilesFixture fixture, VisualTreeObject actual, string fileName)
        {
            var testFileName = fileName + ".tree";

            var serializedActual = SerializeVisualTree(actual);
            var baselineFilePath = fixture.GetSourcePath(testFileName);

            if (_regenerateBaselineFiles)
            {
                TestFiles.UpdateBaseline(baselineFilePath, serializedActual);
            }
            else
            {
                TestFiles.CompareToBaseLine(baselineFilePath, serializedActual);
            }
        }
Пример #2
0
        private static void CompareVisualTreesImplementation(DeployFilesFixture fixture, VisualTreeObject actual, string fileName)
        {
            string testFileName = fileName + ".tree";
            string testFilePath = fixture.GetDestinationPath(testFileName);

            if (_regenerateBaselineFiles)
            {
                var    serializedActual = SerializeVisualTree(actual);
                string baselineFilePath = fixture.GetSourcePath(testFileName);
                TestFiles.UpdateBaseline(baselineFilePath, serializedActual);
            }
            else
            {
                var deserializedExpected = DeserializeVisualTree(testFilePath);
                CompareVisualTree(actual, deserializedExpected);
            }
        }