本文整理汇总了C#中FakeItEasy.Fake.SetupPassThrough方法的典型用法代码示例。如果您正苦于以下问题:C# Fake.SetupPassThrough方法的具体用法?C# Fake.SetupPassThrough怎么用?C# Fake.SetupPassThrough使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FakeItEasy.Fake
的用法示例。
在下文中一共展示了Fake.SetupPassThrough方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestInitialize
public void TestInitialize()
{
_fakeBuilder = new FakeClassBuilder<RateLimitCacheManager>();
_fakeRateLimitCache = _fakeBuilder.GetFake<IRateLimitCache>();
_fakeRateLimitHelper = _fakeBuilder.GetFake<IRateLimitHelper>();
_fakeTwitterRequester = _fakeBuilder.GetFake<ITwitterRequester>();
_fakeHelpQueryGenerator = _fakeBuilder.GetFake<IHelpQueryGenerator>();
_fakeJsonObjectConverter = _fakeBuilder.GetFake<IJsonObjectConverter>();
_fakeCredentialsAccessor = _fakeBuilder.GetFake<ICredentialsAccessor>();
_fakeTwitterQueryFactory = _fakeBuilder.GetFake<ITwitterQueryFactory>();
InitializeData();
_fakeRateLimitHelper.CallsTo(x => x.GetEndpointRateLimitFromQuery(TEST_QUERY, _credentialsRateLimits)).Returns(_endpointRateLimit);
_fakeRateLimitCache.CallsTo(x => x.GetCredentialsRateLimits(_credentials)).Returns(_credentialsRateLimits);
_fakeRateLimitCache.CallsTo(x => x.RefreshEntry(_credentials, _credentialsRateLimits)).Invokes(() =>
{
_fakeRateLimitCache.CallsTo(x => x.GetCredentialsRateLimits(_credentials)).Returns(_refreshedCredentialsRateLimits);
_fakeRateLimitHelper.CallsTo(x => x.GetEndpointRateLimitFromQuery(TEST_QUERY, _refreshedCredentialsRateLimits)).Returns(_refreshedEndpointRateLimit);
});
_fakeCredentialsAccessor.SetupPassThrough<ICredentialsRateLimits>();
_fakeHelpQueryGenerator.CallsTo(x => x.GetCredentialsLimitsQuery()).Returns(TEST_QUERY);
_fakeTwitterRequester.CallsTo(x => x.ExecuteQuery(_twitterQuery, null)).Returns(TEST_QUERY);
_fakeJsonObjectConverter.CallsTo(x => x.DeserializeObject<ICredentialsRateLimits>(TEST_QUERY, It.IsAny<JsonConverter[]>())).ReturnsNextFromSequence(_credentialsRateLimits, _credentialsRateLimits2);
_fakeTwitterQueryFactory.CallsTo(x => x.Create(TEST_QUERY, It.IsAny<HttpMethod>(), It.IsAny<ITwitterCredentials>())).Returns(_twitterQuery);
}