Ejemplo n.º 1
0
        public void GetEmbeddedQuery_Strips_UTF8_BOM()
        {
            const string expected = "UTF8BOM";

            var utf8Bom = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());

            var result = QueryUtilities.GetEmbeddedQuery("Utf8Bom", typeof(RepositoryAncestor));

            Assert.IsFalse(result.StartsWith(utf8Bom, StringComparison.Ordinal));
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
        public void GetEmbeddedQuery_Includes_Included_Queries()
        {
            const string newline = @"
";

            const string expected = @"before first include
/* Utilitron.Include: ./../RepositoryAncestorQueries/IncludeQueryInner.sql */
include query
after first include
before second include
/* Utilitron.Include: /Utilitron/Tests/Data/RepositoryAncestorQueries/IncludeQueryInner.sql */
include query
after second include";

            if (Environment.NewLine != newline)
            {
                Assert.Inconclusive($"Environment.NewLine is not {string.Join(string.Empty, newline.Select(x => ((int) x).ToString("X4")))}.");
            }

            var result = QueryUtilities.GetEmbeddedQuery("IncludeQueryOuter", typeof(RepositoryAncestor));

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 3
0
 public void GetEmbeddedQuery_Throws_InvalidOperationException_If_Includes_Become_Recursive()
 {
     QueryUtilities.GetEmbeddedQuery("IncludeQueryRecursive", typeof(RepositoryAncestor));
 }