本文整理汇总了C#中LinqToTwitter.TwitterContext.CreateRequestProcessor方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterContext.CreateRequestProcessor方法的具体用法?C# TwitterContext.CreateRequestProcessor怎么用?C# TwitterContext.CreateRequestProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinqToTwitter.TwitterContext
的用法示例。
在下文中一共展示了TwitterContext.CreateRequestProcessor方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRequestProcessor_Returns_ProperRequestProcessor
public void CreateRequestProcessor_Returns_ProperRequestProcessor()
{
var ctx = new TwitterContext(auth);
var showQuery =
from tweet in ctx.Status
where tweet.Type == StatusType.Show
select tweet;
var statusProc = ctx.CreateRequestProcessor<Status>(showQuery.Expression);
Assert.IsType(typeof(StatusRequestProcessor<Status>), statusProc);
}
示例2: CreateAccountRequestProcessorTest
public void CreateAccountRequestProcessorTest()
{
var ctx = new TwitterContext(auth);
var queryResult = from tweet in ctx.Account select tweet;
IRequestProcessor<Account> actual = ctx.CreateRequestProcessor<Account>(queryResult.Expression);
Assert.IsType(typeof(AccountRequestProcessor<Account>), actual);
}
示例3: CreateStatusRequestProcessorTest
public void CreateStatusRequestProcessorTest()
{
var ctx = new TwitterContext(auth);
var queryResult = from tweet in ctx.Status select tweet;
IRequestProcessor<Status> actual = ctx.CreateRequestProcessor<Status>(queryResult.Expression);
Assert.IsType(typeof(StatusRequestProcessor<Status>), actual);
}
示例4: CreateRequestProcessor_Returns_StreamingRequestProcessor
public void CreateRequestProcessor_Returns_StreamingRequestProcessor()
{
var ctx = new TwitterContext(auth) {StreamingUrl = "https://stream.twitter.com/1/"};
var execMock = new Mock<ITwitterExecute>();
ctx.TwitterExecutor = execMock.Object;
var streamingQuery =
from tweet in ctx.Streaming
where tweet.Type == StreamingType.Sample
select tweet;
var reqProc = ctx.CreateRequestProcessor<Streaming>(streamingQuery.Expression);
Assert.IsType(typeof(StreamingRequestProcessor<Streaming>), reqProc);
Assert.Equal("https://stream.twitter.com/1/", reqProc.BaseUrl);
var streamingRequestProcessor = reqProc as StreamingRequestProcessor<Streaming>;
if (streamingRequestProcessor != null)
Assert.Equal(execMock.Object, streamingRequestProcessor.TwitterExecutor);
}
示例5: CreateRequestProcessor_Returns_UserStreamRequestProcessor
public void CreateRequestProcessor_Returns_UserStreamRequestProcessor()
{
var ctx = new TwitterContext(auth) {StreamingUrl = "https://userstream.twitter.com/1.1/"};
var execMock = new Mock<ITwitterExecute>();
ctx.TwitterExecutor = execMock.Object;
var streamingQuery =
from tweet in ctx.UserStream
where tweet.Type == UserStreamType.User
select tweet;
var reqProc = ctx.CreateRequestProcessor<UserStream>(streamingQuery.Expression);
Assert.IsType(typeof(UserStreamRequestProcessor<UserStream>), reqProc);
var userStreamRequestProcessor = reqProc as UserStreamRequestProcessor<UserStream>;
if (userStreamRequestProcessor != null)
Assert.Equal("https://userstream.twitter.com/1.1/", userStreamRequestProcessor.UserStreamUrl);
var streamRequestProcessor = reqProc as UserStreamRequestProcessor<UserStream>;
if (streamRequestProcessor != null)
Assert.Equal(execMock.Object, streamRequestProcessor.TwitterExecutor);
}
示例6: CreateRequestProcessor_Returns_RelatedResultsRequestProcessor
public void CreateRequestProcessor_Returns_RelatedResultsRequestProcessor()
{
var ctx = new TwitterContext(auth) {BaseUrl = "https://api.twitter.com/1.1/"};
var execMock = new Mock<ITwitterExecute>();
ctx.TwitterExecutor = execMock.Object;
var resultsQuery =
from tweet in ctx.RelatedResults
where tweet.Type == RelatedResultsType.Show
select tweet;
var reqProc = ctx.CreateRequestProcessor<RelatedResults>(resultsQuery.Expression);
Assert.IsType(typeof(RelatedResultsRequestProcessor<RelatedResults>), reqProc);
Assert.Equal("https://api.twitter.com/1.1/", reqProc.BaseUrl);
}
示例7: CreateRequestProcessorNullExpressionTest1
public void CreateRequestProcessorNullExpressionTest1()
{
var ctx = new TwitterContext(auth);
var ex = Assert.Throws<ArgumentNullException>(() => ctx.CreateRequestProcessor<Status>((Expression)null));
Assert.Equal("Expression", ex.ParamName);
}
示例8: CreateSearchRequestProcessor_Returns_RawRequestProcessor
public void CreateSearchRequestProcessor_Returns_RawRequestProcessor()
{
var ctx = new TwitterContext(auth);
var queryResult = from raw in ctx.RawQuery select raw;
IRequestProcessor<Raw> actual = ctx.CreateRequestProcessor<Raw>(queryResult.Expression);
Assert.IsType(typeof(RawRequestProcessor<Raw>), actual);
}
示例9: CreateFriendshipRequestProcessorTest
public void CreateFriendshipRequestProcessorTest()
{
var ctx = new TwitterContext(auth);
var queryResult = from tweet in ctx.Friendship select tweet;
IRequestProcessor<Friendship> actual = ctx.CreateRequestProcessor<Friendship>(queryResult.Expression);
Assert.IsType(typeof(FriendshipRequestProcessor<Friendship>), actual);
}
示例10: CreateDirectMessageRequestProcessorTest
public void CreateDirectMessageRequestProcessorTest()
{
var ctx = new TwitterContext(auth);
var queryResult = from tweet in ctx.DirectMessage select tweet;
IRequestProcessor<DirectMessage> actual = ctx.CreateRequestProcessor<DirectMessage>(queryResult.Expression);
Assert.IsType(typeof(DirectMessageRequestProcessor<DirectMessage>), actual);
}