Ejemplo n.º 1
0
        public void PublishTweet_ReturnsTwitterAccessorResult()
        {
            // Arrange
            var queryExecutor  = CreateTweetQueryExecutor();
            var tweetDTO       = A.Fake <ITweetDTO>();
            var query          = TestHelper.GenerateString();
            var expectedResult = A.Fake <ITweetDTO>();

            _fakeTweetQueryGenerator.CallsTo(x => x.GetPublishTweetQuery(tweetDTO)).Returns(query);
            _fakeTwitterAccessor.ArrangeExecutePOSTMultipartQuery(query, expectedResult);

            // Act
            var result = queryExecutor.PublishTweet(tweetDTO);

            // Assert
            Assert.AreEqual(result, expectedResult);
        }