本文整理汇总了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");
}
示例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 $$");
}
示例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");
}