本文整理汇总了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>();
}
示例2: Init
public void Init()
{
fixture = new Fixture();
credentials = fixture.Create<ClientCredentials>();
serverUri = fixture.Create<Uri>().ToString();
classUnderTests = fixture.Create<ClientFactory>();
}
示例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();
}
示例4: Customize
public void Customize(IFixture fixture)
{
fixture.Register(() => new TestIndexUtils(
this.settings?? fixture.Create<ISettingsProvider>(),
fixture.Create<ISystemContext>(),
this.requestConfig));
}
示例5: Init
public void Init()
{
_fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
_storage = _fixture.Create<IStateStorage>();
_accessorFactory = _fixture.Create<IStateAccessorFactory>();
_sut = new StateService(_storage);
}
示例6: MessageProcessingAsyncWrapper
public MessageProcessingAsyncWrapper()
{
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
ReceiveMessages = _fixture.Create<IReceiveMessagesFactory>();
MessageContextFactory = _fixture.Create<IMessageContextFactory>();
_fixture.Inject(ReceiveMessages);
_fixture.Inject(MessageContextFactory);
}
示例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;
}
示例8: Customize
public void Customize(IFixture fixture)
{
fixture.Register(() =>
new ElasticLease(
fixture.Create<Guid>(),
DateTime.UtcNow + this.expiresIn,
fixture.Create<ElasticLeaseOwner>()));
}
示例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);
}
示例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);
}
示例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"));
}
示例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>();
}
示例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>();
}
示例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);
}