本文整理汇总了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);
}
示例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>>();
}
示例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>>();
}
示例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>();
}
示例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);
}
示例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>)));
}
示例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;
}
示例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>();
}
示例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"))
));
}
示例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;
}
示例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>();
}
示例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();
}
示例13: SetUp
public void SetUp()
{
fixture = new Fixture()
.Customize(new AutoMoqCustomization())
.Customize(new MvcControllerCustomization());
viewModelFactory = fixture.Freeze<Mock<IMultiplicationTableViewModelFactory>>();
}
示例14: Initialization
public void Initialization()
{
fixture = new Fixture().Customize(new AutoMoqCustomization());
budgetRepositoryMock = fixture.Freeze<Mock<IBudgetRepository>>();
service = fixture.Create<ComptabiliteService>();
}
示例15: Setup
public void Setup()
{
fixture = new Fixture()
.Customize(new AutoMoqCustomization());
pieces = fixture.Freeze<IEnumerable<IPiece>>()
.ToArray();
}