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


C# IFixture.Customize方法代码示例

本文整理汇总了C#中IFixture.Customize方法的典型用法代码示例。如果您正苦于以下问题:C# IFixture.Customize方法的具体用法?C# IFixture.Customize怎么用?C# IFixture.Customize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFixture的用法示例。


在下文中一共展示了IFixture.Customize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Customize

        public void Customize(IFixture fixture)
        {
            ControllerDescriptor(fixture);
            ActionDescriptor(fixture);
            ActionExecutedContext(fixture);
            ActionExecutingContext(fixture);
            ViewEngineResult(fixture);
            ViewContext(fixture);
            ControllerBase(fixture);
            IValueProvider(fixture);
            ModelBindingContext(fixture);
            ValueProviderResult(fixture);

            fixture.Customize<ControllerContext>(cc => cc.Without(c => c.DisplayMode));
            fixture.Customize<ExceptionContext>(ec => ec.Without(c => c.DisplayMode));
            fixture.Customize<ResultExecutedContext>(rec => rec.Without(c => c.DisplayMode));
            fixture.Customize<AuthorizationContext>(ac => ac.Without(c => c.DisplayMode));
            fixture.Customize<ResultExecutingContext>(rec => rec.Without(c => c.DisplayMode));

            fixture.Register<HttpContextBase>(
                () => 
                {
                    var mock = new Mock<HttpContextBase>();
                    mock.Setup(m => m.Items).Returns(new Dictionary<string, object>());
                    return mock.Object;
                });
        }
开发者ID:GitObjects,项目名称:Glimpse,代码行数:27,代码来源:MvcCustomizations.cs

示例2: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<LibraryCard>(x => x.Without(y => y.Id).Without(y => y.Loans));
     fixture.Customize<Author>(x => x.Without(y => y.Id));
     fixture.Customize<Book>(x => x.Without(y => y.Id).Without(y => y.Authors));
     fixture.Customize(new MultipleCustomization());
 }
开发者ID:Draupner,项目名称:DraupnerGeneratedSample,代码行数:7,代码来源:AutoFixtureCustomization.cs

示例3: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<VoIPTransport>(x => x.FromFactory<ITransportApiProvider>(t => new UdpTransport(t)));
     fixture.Customize<Account>(x => x.OmitAutoProperties());
     var account = fixture.Freeze<Mock<Account>>();
     account.SetupGet(x => x.Id).Returns(fixture.CreateAnonymous<int>());
     fixture.Register(() => account.Object);
 }
开发者ID:percramer,项目名称:pjsip4net,代码行数:8,代码来源:AccountCustomization.cs

示例4: Customize

        public void Customize(IFixture fixture)
        {
            fixture.Customize<JournaledEvent>(composer => composer
                .FromFactory(() => JournaledEvent.Create(
                    new object(),
                    (_, type, writer) => writer.WriteLine(fixture.Create("EventPayload")))));

            fixture.Customize<IReadOnlyList<JournaledEvent>>(composer => composer
                .FromFactory((JournaledEvent[] events) => events));
        }
开发者ID:savamura,项目名称:Journalist,代码行数:10,代码来源:JournaledEventCustomization.cs

示例5: Customize

            public void Customize(IFixture fixture)
            {
                fixture.Customize<InMemoryMessageStore>(c =>
                    c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));

                fixture.Customize<InMemoryMessageChannel>(c =>
                    c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));

                fixture.Customize<InMemoryMessageChannel>(c =>
                    c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));
            }
开发者ID:kellabyte,项目名称:HaywireMQ,代码行数:11,代码来源:InMemoryMessageChannelTests.cs

示例6: Customize

        public void Customize(IFixture fixture)
        {
            var settings = new SettingsHolder();
            settings.SetDefault("EndpointName", "UnitTests");
            var config = new PersistenceExtentions<MongoDBPersistence>(settings);

            fixture.Register(() => settings);
            fixture.Register(() => config);

            fixture.Customize<Address>(c => c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));
            fixture.Customize<TimeoutData>(
                c => c.With(t => t.OwningTimeoutManager, config.GetSettings().EndpointName()));
        }
开发者ID:freemsly,项目名称:NServiceBus.MongoDB,代码行数:13,代码来源:ConfigureCustomization.cs

示例7: Customize

        public void Customize(IFixture fixture)
        {
            fixture.Customize<ViewDataDictionary>(c =>
                c.Without(vdd => vdd.ModelMetadata));

            fixture.Customize<HttpContextBase>(ob => ob
                .FromFactory(() =>
                {
                    var contextStub = new Mock<HttpContextBase>();
                    contextStub.SetupProperty(ctx => ctx.User);
                    contextStub.Object.User = fixture.CreateAnonymous<IPrincipal>();
                    return contextStub.Object;
                })
                .OmitAutoProperties());
        }
开发者ID:mesta1,项目名称:dli.net_sourcecode,代码行数:15,代码来源:MvcCustomization.cs

示例8: Customize

 /// <summary>
 /// Customizes the specified fixture by adding the Sitecore specific specimen builders.
 /// </summary>
 /// <param name="fixture">The fixture to customize.</param>
 public void Customize(IFixture fixture)
 {
   fixture.Freeze<Db>();
   fixture.Customize(new ContextDatabaseCustomization());
   fixture.Customizations.Add(
     new CompositeSpecimenBuilder(
       new ItemSpecimenBuilder(),
       new FilteringSpecimenBuilder(
         new Postprocessor(
           new ContentAttributeRelay(),
           new AddContentDbItemCommand()),
         new DbItemParameterSpecification()),
       new FilteringSpecimenBuilder(
         new Postprocessor(
           new ContentAttributeRelay(),
           new AddContentItemCommand()),
         new ItemParameterSpecification()),
       new FilteringSpecimenBuilder(
         new Omitter(),
         new PropertySpecification(typeof(ID), "ParentID")),
       new FilteringSpecimenBuilder(
         new Omitter(),
         new PropertySpecification(typeof(ID), "TemplateID")),
       new FilteringSpecimenBuilder(
         new Omitter(),
         new PropertySpecification(typeof(ID[]), "BaseIDs"))
       ));
 }
开发者ID:dharnitski,项目名称:Sitecore.FakeDb,代码行数:32,代码来源:AutoDbCustomization.cs

示例9: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<Call>(x => x.OmitAutoProperties());
     fixture.Freeze<Mock<ICallManagerInternal>>();
     var call = fixture.Freeze<Mock<Call>>();
     fixture.Register(() => call.Object);
 }
开发者ID:percramer,项目名称:pjsip4net,代码行数:7,代码来源:CallCustomization.cs

示例10: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize(
         new CompositeCustomization(
             new MultipleCustomization(),
             new AutoMoqCustomization()));
 }
开发者ID:moodmosaic-attic,项目名称:System.Web.Mvc.Composition,代码行数:7,代码来源:AutoMvcDataAttribute.cs

示例11: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<HttpRequestMessage>(c => c
         .Without(x => x.Content)
         .Do(x => x.Properties[HttpPropertyKeys.HttpConfigurationKey] =
             new HttpConfiguration()));
 }
开发者ID:wyattwebb,项目名称:ApprovalTestsTalk,代码行数:7,代码来源:HttpRequestMessageCustomization.cs

示例12: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<HttpConfiguration>(
         c => c
             .OmitAutoProperties()
             .Do(config => config.MapHttpAttributeRoutes()));
 }
开发者ID:lofrank,项目名称:JSendWebApi,代码行数:7,代码来源:TestConventions.cs

示例13: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<ModelBindingContext>(c => c
         .Without(x => x.Model)
         .Without(x => x.ModelType));
     fixture.Inject(CultureInfo.CurrentCulture);
 }
开发者ID:Winsto,项目名称:Booking,代码行数:7,代码来源:WebModelCustomization.cs

示例14: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<ConvertToClaimRulesCommand>(c =>
         c
             .OmitAutoProperties()
             .With(cmd => cmd.RoleAssignmentFile, ".\\PPJ rettigheder 2013.10.08.xlsx")
     );
 }
开发者ID:sgryt,项目名称:PPJ,代码行数:8,代码来源:ConvertToClaimRulesCustomization.cs

示例15: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Customize<DummyModel>(x => x.FromFactory(() => {
     var output = new Mock<DummyModel>() { CallBase = true };
     output.As<IModel>();
     return output.Object;
       }));
 }
开发者ID:csf-dev,项目名称:ZPT-Sharp,代码行数:8,代码来源:DummyModelCustomisation.cs


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