Beispiel #1
0
        public static void Validate <R>(ISupportSnapshot <R> testClass,
                                        string testName,
                                        Func <R[], KanbanContext, object> testFunction,
                                        [System.Runtime.CompilerServices.CallerMemberName] string member = "")
        {
            using (var context = ArdaTestMgr.GetTransactionContext())
            {
                var    before     = testClass.GetSnapshot(context).ToArray();
                string beforeText = SerializeObject(before);

                var returnObject = testFunction(before, context);

                string returnObjectText = SerializeObject(returnObject);

                string result = $"BEFORE:\n=======\n{beforeText}\n\nCOMMAND: {testName}\n\nAFTER:\n======\n{returnObjectText}";

                CompareResults(result, member);
            }
        }