/// <summary>
        /// Given 2 strings, filters the left-hand string and checks whether the filtered output matches that of the right-hand string.
        /// </summary>
        /// <param name="filter">The source filter to apply</param>
        /// <param name="defines">The preprocessor definitions which are to be used by the source filter</param>
        /// <param name="lhs">The left-hand string whose value will be filtered</param>
        /// <param name="rhs">The right-hand string whose value is used to compare the filtered result</param>
        protected void FilterAndCompare(ISourceFilter filter, Defines defines, string lhs, string rhs)
        {
            var cppSourceFile = new CppSourceFile(){SourceCode = lhs};
            filter.Filter(cppSourceFile, defines);

            Assert.AreEqual(cppSourceFile.SourceCode, rhs);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Given 2 strings, filters the left-hand string and checks whether the filtered output matches that of the right-hand string.
        /// </summary>
        /// <param name="filter">The source filter to apply</param>
        /// <param name="defines">The preprocessor definitions which are to be used by the source filter</param>
        /// <param name="lhs">The left-hand string whose value will be filtered</param>
        /// <param name="rhs">The right-hand string whose value is used to compare the filtered result</param>
        protected void FilterAndCompare(ISourceFilter filter, Defines defines, string lhs, string rhs)
        {
            var cppSourceFile = new CppSourceFile()
            {
                SourceCode = lhs
            };

            filter.Filter(cppSourceFile, defines);

            Assert.AreEqual(cppSourceFile.SourceCode, rhs);
        }