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


C# IFixture.Freeze方法代码示例

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


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

示例1: 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

示例2: Initialize

 public void Initialize()
 {
     _fixture =
         new Fixture().Customize(new ApiControllerCustomization<ProjectController>())
             .Customize(new HttpResponseMessageCustomization());
     _projectRetrieverServiceMock = _fixture.Freeze<Mock<IProjectRetrieverService>>();
     _projectCreationServiceMock = _fixture.Freeze<Mock<IProjectCreationService>>();
 }
开发者ID:iburgos,项目名称:net-igeo-service,代码行数:8,代码来源:ProjectControllerTests.cs

示例3: Initialize

 public void Initialize()
 {
     _fixture = new Fixture().Customize(new AutoConfiguredMoqCustomization());
     _projectDocumentRepositoryMock = _fixture.Freeze<Mock<IProjectDocumentRepository>>();
     _mapperMock = _fixture.Freeze<Mock<IMapper>>();
     _serviceResultCreatorMock = _fixture.Freeze<Mock<IServiceResultCreator>>();
     _dateTimeProviderMock = _fixture.Freeze<Mock<IDateTimeProvider>>();
 }
开发者ID:iburgos,项目名称:net-igeo-service,代码行数:8,代码来源:ProjectUpdateServiceTests.cs

示例4: Initialize

        public void Initialize()
        {
            _fixture = new Fixture().Customize(new AutoConfiguredMoqCustomization());
            _documentStoreMock = _fixture.Freeze<Mock<IDocumentStore>>();
            _documentSessionMock = _fixture.Freeze<Mock<IDocumentSession>>();
            _logMock = _fixture.Freeze<Mock<ILog>>();

            _document = _fixture.Create<IDocument>();
        }
开发者ID:iburgos,项目名称:net-igeo-service,代码行数:9,代码来源:DocumentStorerTests.cs

示例5: AdversarialSearchTestFixture

        public AdversarialSearchTestFixture()
        {
            _fixture = new Fixture().Customize(new AutoMoqCustomization());

            _problem = _fixture.Freeze<Mock<IAdversarialSearchProblem<TreeState, TreeAction>>>();
            _stateEvaluator = _fixture.Freeze<Mock<IStateEvaluator<TreeState>>>();
            _tree = new TestTree();
            _tree.SetupProblem(_problem, _stateEvaluator);
        }
开发者ID:SlowShip,项目名称:AI,代码行数:9,代码来源:AdversarialSearch.TestFixture.cs

示例6: Customize

		public void Customize(IFixture fixture)
		{
			fixture.Freeze<MemoryStream>(b => b.FromFactory(() => new MemoryStream()).OmitAutoProperties());
			fixture.Freeze<Mock<IHttpResponseContent>>(b =>
				b.Do(content => content.Setup(c => c.ReadStream(It.IsAny<CancellationToken>())).ReturnsTask(fixture.Create<MemoryStream>())));
			fixture.Customize<Mock<IHttpRequestResult>>(b =>
				b.Do(result => result.Setup(r => r.Content).Returns(fixture.Create<IHttpResponseContent>)));


		}
开发者ID:Galad,项目名称:Hanno,代码行数:10,代码来源:DeserializerHttpRequestResultReaderTests.cs

示例7: SetToCurrentProjectIfSupported_

        public Project SetToCurrentProjectIfSupported_(IFixture fixture)
        {
            // Arrange
            var vm = new PrigPackageViewModel();

            // Act
            vm.SetToCurrentProjectIfSupported(fixture.Freeze<Project>());

            // Assert
            fixture.Freeze<Mock<Project>>().VerifyAll();
            return vm.CurrentProject.Value;
        }
开发者ID:umaranis,项目名称:Prig,代码行数:12,代码来源:PrigPackageViewModelTest.cs

示例8: Setup

        public void Setup()
        {
            _fixture = new Fixture()
                  .Customize(new AutoMoqCustomization())
                  .Customize(new MultipleCustomization());

            _httpService = _fixture.Freeze<Mock<IHttpService>>();
            _httpCachingService = _fixture.Freeze<Mock<IHttpCachingService>>();

            _baseAddress = _fixture.Create<string>();
            _uri = _fixture.Create<string>();
            _headers = _fixture.Create<Dictionary<string, string>>();

            _sut = _fixture.Create<HttpAsyncClient>();
        }
开发者ID:Marknumskull,项目名称:Azert.HttpClient,代码行数:15,代码来源:HttpAsyncClientTests.cs

示例9: 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

示例10: HalClientTestContext

        public HalClientTestContext()
        {
            _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());

            _http = _fixture.Freeze<IJsonHttpClient>();

            _version = _fixture.Create<Version>();
            _order = _fixture.Create<Order>();
            _orderItem = _fixture.Create<OrderItem>();
            _paged = _fixture.Create<PagedList>();
            OrderAdd = _fixture.Create<OrderAdd>();
            OrderEdit = _fixture.Create<OrderEdit>();

            _sut = new HalClient(_http);

            _curies =
                new[]
                {
                    new
                    {
                        href = "https://retail.com/v1/docs/{rel}",
                        name = Curie,
                        templated = true
                    }
                };
            _hasCurie = true;
        }
开发者ID:eoin55,项目名称:HoneyBear.HalClient,代码行数:27,代码来源:HalClientTestContext.cs

示例11: SetUp

 public void SetUp()
 {
     _fixture = new Fixture().Customize(new AutoMoqCustomization());
     _surveyAppRepository = _fixture.Freeze<Mock<ISurveyRepository>>();
     _sut = _fixture.Create<SurveyAppService>();
     _expected = _fixture.Create<SoundConnect.Survey.Core.Entities.Survey>();
 }
开发者ID:jdberrocal1,项目名称:WebFundamentals,代码行数:7,代码来源:SurveyAppServiceTest.cs

示例12: Setup

 public void Setup()
 {
     _fixture = new Fixture().Customize(new AutoMoqCustomization());
     var container = _fixture.Freeze<Mock<IContainer>>();
     _sut =
         _fixture.Build<AutoMappingMapper>().FromFactory(
             () => new AutoMappingMapper(Mapper.Engine, container.Object)).CreateAnonymous();
 }
开发者ID:kumarkmmca,项目名称:pjsip4net,代码行数:8,代码来源:given_a_mapper.cs

示例13: SetUp

        public void SetUp()
        {
            fixture = new Fixture()
                .Customize(new AutoMoqCustomization())
                .Customize(new MvcControllerCustomization());

            viewModelFactory = fixture.Freeze<Mock<IMultiplicationTableViewModelFactory>>();
        }
开发者ID:SlowShip,项目名称:PrimeTables,代码行数:8,代码来源:HomeController.TestFixture.cs

示例14: Initialization

        public void Initialization()
        {
            fixture = new Fixture().Customize(new AutoMoqCustomization());

            budgetRepositoryMock = fixture.Freeze<Mock<IBudgetRepository>>();

            service = fixture.Create<ComptabiliteService>();
        }
开发者ID:drioemgaoin,项目名称:ComptabiliteSpecFlow,代码行数:8,代码来源:ComptabiliteSpecFlowSteps.cs

示例15: Setup

        public void Setup()
        {
            fixture = new Fixture()
                .Customize(new AutoMoqCustomization());

            pieces = fixture.Freeze<IEnumerable<IPiece>>()
                .ToArray();
        }
开发者ID:kenkam,项目名称:reversal,代码行数:8,代码来源:PieceBagTestFixture.cs


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