예제 #1
0
        /// <summary>
        /// Test that entry source is equivalent to given source after edit actions.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="source">Expected source.</param>
        public static void AssertSourceEquivalence(this TestingAssembly assembly, string source)
        {
            var result       = assembly.GetResult(Method.EntryInfo.MethodID);
            var editedSource = assembly.GetEntrySource(result.View);

            var nSource       = normalizeCode("{" + source + "}");
            var nEditedSource = normalizeCode(editedSource);

            Assert.AreEqual(nSource, nEditedSource);
        }
예제 #2
0
        /// <summary>
        /// Asserts condition on the variable. E.g. HasValue condition can be used.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="variableName">Name of the variable.</param>
        /// <returns>TestCase.</returns>
        internal static TestCase AssertVariable(this TestingAssembly assembly, string variableName)
        {
            var result = assembly.GetResult(Method.EntryInfo.MethodID);

            return(new TestCase(result, variableName));
        }