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


C# IFixture.Create方法代码示例

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


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

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

示例2: Init

 public void Init()
 {
     fixture = new Fixture();
     credentials = fixture.Create<ClientCredentials>();
     serverUri = fixture.Create<Uri>().ToString();
     classUnderTests = fixture.Create<ClientFactory>();
 }
开发者ID:MarcinKowal,项目名称:SmartDom,代码行数:7,代码来源:ClientFactoryTests.cs

示例3: CreateMainViewModel

 private MainViewModel CreateMainViewModel(IFixture fixture, IMessenger messenger = null)
 {
     var channel = fixture.Create<IChannel<SaveCmdApplicationConfigurationCommand>>();
     fixture.Register<ICmdApplicationConfigurationViewModelFactory>(() => fixture.Create<CmdApplicationConfigurationViewModelFactory>());
     fixture.Inject(messenger ?? new Messenger());
     return fixture.Build<MainViewModel>().OmitAutoProperties().Create();
 }
开发者ID:rahulpnath,项目名称:clal,代码行数:7,代码来源:MainViewModelTests.cs

示例4: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Register(() => new TestIndexUtils(
         this.settings?? fixture.Create<ISettingsProvider>(), 
         fixture.Create<ISystemContext>(), 
         this.requestConfig));
 }
开发者ID:freemsly,项目名称:Sitecore-ElasticAnalytics,代码行数:7,代码来源:TestIndicesUtilCustomization.cs

示例5: Init

 public void Init()
 {
     _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
     _storage = _fixture.Create<IStateStorage>();
     _accessorFactory = _fixture.Create<IStateAccessorFactory>();
     _sut = new StateService(_storage);
 }
开发者ID:junshao,项目名称:Medidata.Cloud.StateBroker,代码行数:7,代码来源:StateServiceTests.cs

示例6: MessageProcessingAsyncWrapper

 public MessageProcessingAsyncWrapper()
 {
     _fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
     ReceiveMessages = _fixture.Create<IReceiveMessagesFactory>();
     MessageContextFactory = _fixture.Create<IMessageContextFactory>();
     _fixture.Inject(ReceiveMessages);
     _fixture.Inject(MessageContextFactory);
 }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:8,代码来源:MessageProcessingAsyncTests.cs

示例7: CreateWithContent

 public static DirectoryInfo CreateWithContent(this DirectoryInfo info, IFixture fixture)
 {
     info.Create();
     var path = Path.Combine(info.FullName, fixture.Create<string>());
     using (var sw = new StreamWriter(new FileInfo(path).Open(FileMode.Create)))
         sw.WriteLine(fixture.Create<string>());
     return info;
 }
开发者ID:umaranis,项目名称:Prig,代码行数:8,代码来源:DirectoryInfoMixin.cs

示例8: Customize

 public void Customize(IFixture fixture)
 {
     fixture.Register(() =>
             new ElasticLease(
                 fixture.Create<Guid>(), 
                 DateTime.UtcNow + this.expiresIn, 
                 fixture.Create<ElasticLeaseOwner>()));
 }
开发者ID:freemsly,项目名称:Sitecore-ElasticAnalytics,代码行数:8,代码来源:ElasticLeaseCustomization.cs

示例9: Init

        public void Init()
        {
            _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
            _storage = _fixture.Create<IStateStorage>();
            _target = _fixture.Create<object>();
            var targetIdentity = RuntimeHelpers.GetHashCode(_target);
            _storage.Stub(x => x.GetStorage(targetIdentity)).Return(new Dictionary<string, object>());

            _sut = new StateAccessor(_target, _storage);
        }
开发者ID:junshao,项目名称:Medidata.Cloud.StateBroker,代码行数:10,代码来源:StateAccessorTests.cs

示例10: MessageProcessingWrapper

 public MessageProcessingWrapper()
 {
     _fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
     ReceiveMessages = _fixture.Create<IReceiveMessages>();
     var factory = _fixture.Create<IReceiveMessagesFactory>();
     factory.Create().ReturnsForAnyArgs(ReceiveMessages);
     _fixture.Inject(factory);
     MessageContextFactory = _fixture.Create<IMessageContextFactory>();
     _fixture.Inject(ReceiveMessages);
     _fixture.Inject(MessageContextFactory);
 }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:11,代码来源:MessageProcessingTests.cs

示例11: Init

        public void Init()
        {
            _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
            _sut = MockRepository.GeneratePartialMock<ComponentInfoHandler>();

            _currentAssembly = _fixture.Create<Assembly>();
            _sut.Stub(x => x.GetComponentAssembly()).Return(_currentAssembly);

            _question = _fixture.Create<IThermometerQuestion>();
            _question.Stub(x => x.RequestUri).Return(new Uri("http://servername:8888/xxx/yyy?a=b&c=d"));
        }
开发者ID:junshao,项目名称:Medidata.Cloud.Thermometer.RaveCommon,代码行数:11,代码来源:ComponentInfoHandlerTests.cs

示例12: Setup

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

            _cache = new Dictionary<string, RandomObject>();
            _baseAddress = _fixture.Create<string>();
            _uri = _fixture.Create<string>();

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

示例13: Init

        public void Init()
        {
            _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
            _concreteStarter = _fixture.Create<IThermometerStarter>();
            _disposible = _fixture.Create<IDisposable>();

            var tcs = new TaskCompletionSource<IDisposable>();
            tcs.SetResult(_disposible);
            _disposibleTask = tcs.Task;

            _concreteStarter.Stub(x => x.Start()).Return(_disposible);
            _concreteStarter.Stub(x => x.StartAsync()).Return(_disposibleTask);
        }
开发者ID:junshao,项目名称:Medidata.Cloud.Thermometer.RaveCommon,代码行数:13,代码来源:ThermometerConditionalStarterTests.cs

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

示例15: For_ReturnsCombinationOfDepthAndMemberTypesStrings

        public void For_ReturnsCombinationOfDepthAndMemberTypesStrings(
            [Frozen] IGetDepthString getDepthString,
            [Frozen] IGetMemberTypesString getMemberTypesString,
            DefaultGetNodeString sut,
            string depthString,
            string memberTypesString,
            int depth,
            IFixture fixture)
        {
            // Arrange
            fixture.MakeNonRecursive();

            var graphNode = fixture.Create<GraphNode>();

            getDepthString.For(depth).Returns(depthString);
            getMemberTypesString.For(graphNode).Returns(memberTypesString);

            var expectedResult = depthString + memberTypesString;

            // Act
            var result = sut.For(graphNode, depth);

            // Assert
            Assert.Equal(expectedResult, result);
        }
开发者ID:TeaDrivenDev,项目名称:Graphology,代码行数:25,代码来源:DefaultGetNodeStringTests.cs


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