当前位置: 首页>>代码示例>>C#>>正文


C# FileSystem.ShouldContain方法代码示例

本文整理汇总了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;");
 }
开发者ID:spascoe,项目名称:ripple,代码行数:7,代码来源:ExtractSampleCommandTester.cs

示例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");
        }
开发者ID:wbinford,项目名称:bottles,代码行数:9,代码来源:FileSystemExtensionsTester.cs

示例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\"");
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:14,代码来源:GemReferenceTester.cs

示例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
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:19,代码来源:GemReferenceTester.cs

示例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>");
        }
开发者ID:nieve,项目名称:marten,代码行数:22,代码来源:dumping_the_complete_source_code_Tests.cs

示例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
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:22,代码来源:GemReferenceTester.cs

示例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$;");
        }
开发者ID:JasperFx,项目名称:marten,代码行数:23,代码来源:WritePatch_smoke_tests.cs


注:本文中的FileSystem.ShouldContain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。