當前位置: 首頁>>代碼示例>>C#>>正文


C# FileSystem.ShouldContain方法代碼示例

本文整理匯總了C#中System.IO.FileSystem.ShouldContain方法的典型用法代碼示例。如果您正苦於以下問題:C# FileSystem.ShouldContain方法的具體用法?C# FileSystem.ShouldContain怎麽用?C# FileSystem.ShouldContain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IO.FileSystem的用法示例。


在下文中一共展示了FileSystem.ShouldContain方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: write_ddl_by_type_generates_the_all_sql_script

        public void write_ddl_by_type_generates_the_all_sql_script()
        {
            using (var store = DocumentStore.For(_ =>
            {
                _.RegisterDocumentType<User>();
                _.RegisterDocumentType<Company>();
                _.RegisterDocumentType<Issue>();

                _.Events.AddEventType(typeof(MembersJoined));

                _.Connection(ConnectionSource.ConnectionString);

                _.Transforms.LoadFile("get_fullname.js");
            }))
            {
                store.Schema.WriteDDLByType(@"bin\allsql");
            }

            var filename = @"bin\allsql".AppendPath("all.sql");

            var lines = new FileSystem().ReadStringFromFile(filename).ReadLines().ToArray();

            lines.ShouldContain("\\i user.sql");
            lines.ShouldContain("\\i company.sql");
            lines.ShouldContain("\\i issue.sql");
            lines.ShouldContain("\\i mt_hilo.sql");
            lines.ShouldContain("\\i eventstore.sql");
            lines.ShouldContain("\\i get_fullname.sql");


        }
開發者ID:phillip-haydon,項目名稱:marten,代碼行數:31,代碼來源:DocumentSchemaTests.cs

示例2: writes_transform_function

        public void writes_transform_function()
        {
            using (var store = DocumentStore.For(_ =>
            {
                _.RegisterDocumentType<User>();
                _.RegisterDocumentType<Company>();
                _.RegisterDocumentType<Issue>();

                _.Events.AddEventType(typeof(MembersJoined));

                _.Connection(ConnectionSource.ConnectionString);

                _.Transforms.LoadFile("get_fullname.js");
            }))
            {
                store.Schema.WriteDDLByType(@"bin\allsql");
            }

            var file = @"bin\allsql".AppendPath("get_fullname.sql");
            var lines = new FileSystem().ReadStringFromFile(file).ReadLines().ToArray();


            lines.ShouldContain("CREATE OR REPLACE FUNCTION public.mt_transform_get_fullname(doc JSONB) RETURNS JSONB AS $$");
        }
開發者ID:phillip-haydon,項目名稱:marten,代碼行數:24,代碼來源:DocumentSchemaTests.cs

示例3: write_ddl_by_type_generates_the_all_sql_script

        public void write_ddl_by_type_generates_the_all_sql_script()
        {
            using (var store = DocumentStore.For(_ =>
            {
                _.RegisterDocumentType<User>();
                _.RegisterDocumentType<Company>();
                _.RegisterDocumentType<Issue>();

                _.DatabaseSchemaName = "yet_another";
                _.Schema.For<User>().DatabaseSchemaName("other");

                _.Events.AddEventType(typeof(MembersJoined));

                _.Connection(ConnectionSource.ConnectionString);
            }))
            {
                store.Schema.WriteDDLByType(@"bin\allsql");
            }

            var filename = @"bin\allsql".AppendPath("all.sql");

            var lines = new FileSystem().ReadStringFromFile(filename).ReadLines().Select(x => x.Trim()).ToArray();

            // should create the schemas too
            lines.ShouldContain("EXECUTE 'CREATE SCHEMA yet_another';");
            lines.ShouldContain("EXECUTE 'CREATE SCHEMA other';");

            lines.ShouldContain("\\i user.sql");
            lines.ShouldContain("\\i company.sql");
            lines.ShouldContain("\\i issue.sql");
            lines.ShouldContain("\\i mt_hilo.sql");
            lines.ShouldContain("\\i eventstore.sql");
        }
開發者ID:danielmarbach,項目名稱:marten,代碼行數:33,代碼來源:DocumentSchemaOnOtherSchemaTests.cs


注:本文中的System.IO.FileSystem.ShouldContain方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。