本文整理汇总了C#中FileSystem.ShouldContain方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.ShouldContain方法的具体用法?C# FileSystem.ShouldContain怎么用?C# FileSystem.ShouldContain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem.ShouldContain方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: should_write_out_the_second_sample
public void should_write_out_the_second_sample()
{
var sample2 = new FileSystem().ReadStringFromFile("samples", "Sample2.txt");
sample2.ShouldContain("private string otherName;");
sample2.ShouldContain("private string moreVariables;");
sample2.ShouldContain("private int order;");
}
示例2: find_assembly_names_smoke_tester
public void find_assembly_names_smoke_tester()
{
var names = new FileSystem().FindAssemblyNames(".".ToFullPath());
names.ShouldContain("StructureMap");
names.ShouldContain("Bottles");
names.ShouldContain("Bottles.Tests");
names.ShouldContain("FubuCore");
}
示例3: write_gem_file_when_none_exists
public void write_gem_file_when_none_exists()
{
var context = TemplatePlan.CreateClean("gems");
var gem = new GemReference("rake", ">=10.0.3");
gem.Alter(context);
var gemFile = "gems".AppendPath("Gemfile");
var contents = new FileSystem().ReadStringFromFile(gemFile)
.SplitOnNewLine();
contents.ShouldContain("source 'http://rubygems.org'");
contents.ShouldContain("gem \"rake\", \">=10.0.3\"");
}
示例4: do_add_gem_to_existing
public void do_add_gem_to_existing()
{
var gemFile = "gems".AppendPath("Gemfile");
new FileSystem().WriteStringToFile(gemFile, @"source 'http://rubygems.org'
gem ~rake~, ~>=10.0.3~
".Replace("~", "\""));
var context = TemplatePlan.CreateClean("gems");
var gem = new GemReference("fuburake", "~>0.5");
gem.Alter(context);
var contents = new FileSystem().ReadStringFromFile(gemFile)
.SplitOnNewLine();
contents.ShouldContain("source 'http://rubygems.org'");
contents.ShouldContain("gem \"fuburake\", \"~>0.5\""); // didn't change
}
示例5: write_code_for_all_the_known_document_types
public void write_code_for_all_the_known_document_types()
{
// SAMPLE: exporting_the_storage_code
using (var store = DocumentStore.For(_ =>
{
_.Connection(ConnectionSource.ConnectionString);
_.RegisterDocumentType<User>();
_.RegisterDocumentType<Company>();
_.RegisterDocumentType<Issue>();
}))
{
store.Advanced.WriteStorageCode("storage.cs");
}
// ENDSAMPLE
var generatedCode = new FileSystem().ReadStringFromFile("storage.cs");
generatedCode.ShouldContain("public class UserStorage : Resolver<User>, IDocumentStorage, IBulkLoader<User>, IdAssignment<User>, IResolver<User>");
generatedCode.ShouldContain("public class CompanyStorage : Resolver<Company>, IDocumentStorage, IBulkLoader<Company>, IdAssignment<Company>, IResolver<Company>");
generatedCode.ShouldContain("public class IssueStorage : Resolver<Issue>, IDocumentStorage, IBulkLoader<Issue>, IdAssignment<Issue>, IResolver<Issue>");
}
示例6: do_not_add_gem_when_there_is_already_a_reference
public void do_not_add_gem_when_there_is_already_a_reference()
{
var gemFile = "gems".AppendPath("Gemfile");
var context = TemplatePlan.CreateClean("gems");
new FileSystem().WriteStringToFile(gemFile, @"source 'http://rubygems.org'
gem ~rake~, ~>=10.0.3~
".Replace("~", "\""));
var gem = new GemReference("rake", ">=10.0.4");
gem.Alter(context);
var contents = new FileSystem().ReadStringFromFile(gemFile)
.SplitOnNewLine();
contents.ShouldContain("source 'http://rubygems.org'");
contents.ShouldContain("gem \"rake\", \">=10.0.3\""); // didn't change
contents.ShouldNotContain("gem \"rake\", \">=10.0.4\""); // didn't change
}
示例7: can_create_patch_for_a_single_document_type
public void can_create_patch_for_a_single_document_type()
{
StoreOptions(_ =>
{
// This is enough to tell Marten that the User
// document is persisted and needs schema objects
_.Schema.For<User>();
});
var patch = theStore.Schema.ToPatch(typeof(User));
patch.UpdateDDL.ShouldContain("CREATE OR REPLACE FUNCTION public.mt_upsert_user");
patch.UpdateDDL.ShouldContain("CREATE TABLE public.mt_doc_user");
patch.RollbackDDL.ShouldContain("drop table if exists public.mt_doc_user cascade;");
var file = AppContext.BaseDirectory.AppendPath("bin", "update_users.sql");
patch.WriteUpdateFile(file);
var text = new FileSystem().ReadStringFromFile(file);
text.ShouldContain("DO LANGUAGE plpgsql $tran$");
text.ShouldContain("$tran$;");
}