當前位置: 首頁>>代碼示例>>C#>>正文


C# AsyncSubject.Next方法代碼示例

本文整理匯總了C#中AsyncSubject.Next方法的典型用法代碼示例。如果您正苦於以下問題:C# AsyncSubject.Next方法的具體用法?C# AsyncSubject.Next怎麽用?C# AsyncSubject.Next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AsyncSubject的用法示例。


在下文中一共展示了AsyncSubject.Next方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PhotosGetCountsAsyncTest

        public void PhotosGetCountsAsyncTest()
        {
            DateTime date1 = DateTime.Today.AddMonths(-12);
            DateTime date2 = DateTime.Today.AddMonths(-6);
            DateTime date3 = DateTime.Today;

            DateTime[] uploadDates = new DateTime[] { date1, date2, date3 };

            Flickr f = TestData.GetAuthInstance();

            var w = new AsyncSubject<FlickrResult<PhotoCountCollection>>();
            f.PhotosGetCountsAsync(uploadDates, false, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);

            var counts = result.Result;

            Assert.AreEqual(2, counts.Count, "Should be two counts returned.");

            var count1 = counts[0];

            Assert.AreEqual(date1, count1.FromDate);
            Assert.AreEqual(date2, count1.ToDate);

            var count2 = counts[1];
            Assert.AreEqual(date2, count2.FromDate);
            Assert.AreEqual(date3, count2.ToDate);
        }
開發者ID:MichaelAzar,項目名稱:flickr-net,代碼行數:29,代碼來源:PhotosAsyncTests.cs

示例2: PhotosetsGetContextAsyncTest

        public void PhotosetsGetContextAsyncTest()
        {
            Flickr f = TestData.GetInstance();

            var photosetId = "72157626420254033"; // Beamish
            var photos = f.PhotosetsGetPhotos(photosetId, 1, 100);
            var firstPhoto = photos.First();
            var lastPhoto = photos.Last();

            var w = new AsyncSubject<FlickrResult<Context>>();

            f.PhotosetsGetContextAsync(firstPhoto.PhotoId, photosetId, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);

            var context = result.Result;

            Assert.IsNull(context.PreviousPhoto, "As this is the first photo the previous photo should be null.");
            Assert.IsNotNull(context.NextPhoto, "As this is the first photo the next photo should not be null.");

            w = new AsyncSubject<FlickrResult<Context>>();

            f.PhotosetsGetContextAsync(lastPhoto.PhotoId, photosetId, r => { w.OnNext(r); w.OnCompleted(); });
            result = w.Next().First();

            Assert.IsFalse(result.HasError);

            context = result.Result;

            Assert.IsNull(context.NextPhoto, "As this is the last photo the next photo should be null.");
            Assert.IsNotNull(context.PreviousPhoto, "As this is the last photo the previous photo should not be null.");
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:33,代碼來源:PhotosetsAsyncTests.cs

示例3: PhotosetsGeneralAsyncTest

        public void PhotosetsGeneralAsyncTest()
        {
            Flickr f = TestData.GetAuthInstance();

            var photoId1 = "7519320006"; // Tree/Write/Wall
            var photoId2 = "7176125763"; // Rainbow Rose

            var w = new AsyncSubject<FlickrResult<Photoset>>();
            f.PhotosetsCreateAsync("Test Photoset", photoId1, r => { w.OnNext(r); w.OnCompleted(); });

            var photosetResult = w.Next().First();
            Assert.IsFalse(photosetResult.HasError);
            var photoset = photosetResult.Result;

            try
            {
                var w2 = new AsyncSubject<FlickrResult<NoResponse>>();
                f.PhotosetsEditMetaAsync(photoset.PhotosetId, "New Title", "New Description", r => { w2.OnNext(r); w2.OnCompleted(); });
                var noResponseResult = w2.Next().First();
                Assert.IsFalse(noResponseResult.HasError);

                var w3 = new AsyncSubject<FlickrResult<NoResponse>>();
                f.PhotosetsAddPhotoAsync(photoset.PhotosetId, photoId2, r => { w3.OnNext(r); w3.OnCompleted(); });

                noResponseResult = w3.Next().First();
                Assert.IsFalse(noResponseResult.HasError);
            }
            finally
            {
                var w4 = new AsyncSubject<FlickrResult<NoResponse>>();
                // Clean up and delete photoset
                f.PhotosetsDeleteAsync(photoset.PhotosetId, r => { w4.OnNext(r); w4.OnCompleted(); });
                var noResponseResult = w4.Next().First();
            }
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:35,代碼來源:PhotosetsAsyncTests.cs

示例4: PhotosGetExifAsyncTest

        public void PhotosGetExifAsyncTest()
        {
            Flickr f = TestData.GetInstance();

            var w = new AsyncSubject<FlickrResult<ExifTagCollection>>();
            f.PhotosGetExifAsync(TestData.PhotoId, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);
        }
開發者ID:MichaelAzar,項目名稱:flickr-net,代碼行數:10,代碼來源:PhotosAsyncTests.cs

示例5: PhotosGetContactsPhotosAsyncTest

        public void PhotosGetContactsPhotosAsyncTest()
        {
            var w = new AsyncSubject<FlickrResult<PhotoCollection>>();
            AuthInstance.PhotosGetContactsPhotosAsync(50, true, true, true, PhotoSearchExtras.All, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);
            Assert.IsNotNull(result.Result);

            Assert.IsTrue(result.Result.Count > 0, "Should return some photos.");
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:11,代碼來源:PhotosSearchAsyncTests.cs

示例6: PhotosAddTagTest

        public void PhotosAddTagTest()
        {
            string photoId = "4499284951";
            string tag = "testx";

            var w = new AsyncSubject<FlickrResult<NoResponse>>();

            AuthInstance.PhotosAddTagsAsync(photoId, tag, r => { w.OnNext(r); w.OnCompleted(); });

            var result = w.Next().First();
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:11,代碼來源:PhotosSearchAsyncTests.cs

示例7: StatsGetPhotosetDomainsAsyncTest

        public void StatsGetPhotosetDomainsAsyncTest()
        {
            Flickr f = TestData.GetAuthInstance();

            DateTime d = DateTime.Today.AddDays(-7);

            var w = new AsyncSubject<FlickrResult<StatDomainCollection>>();
            f.StatsGetPhotosetDomainsAsync(d, 1, 25, r => { w.OnNext(r); w.OnCompleted(); });

            var result = w.Next().First();
            Assert.IsFalse(result.HasError);
        }
開發者ID:h4ck3rm1k3,項目名稱:FlickrNet,代碼行數:12,代碼來源:StatsAsyncTests.cs

示例8: PhotosGetRecentAsyncTest

        public void PhotosGetRecentAsyncTest()
        {
            Flickr f = TestData.GetInstance();
            var w = new AsyncSubject<FlickrResult<PhotoCollection>>();
            f.PhotosGetRecentAsync(1, 50, PhotoSearchExtras.All, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);
            Assert.IsNotNull(result.Result);

            Assert.IsTrue(result.Result.Count > 0, "Should return some photos.");
        }
開發者ID:MichaelAzar,項目名稱:flickr-net,代碼行數:12,代碼來源:PhotosAsyncTests.cs

示例9: PhotosSearchAsyncBasicTest

        public void PhotosSearchAsyncBasicTest()
        {
            var o = new PhotoSearchOptions();
            o.Tags = "microsoft";

            var w = new AsyncSubject<FlickrResult<PhotoCollection>>();

            Instance.PhotosSearchAsync(o, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsTrue(result.Result.Total > 0);
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:12,代碼來源:PhotosSearchAsyncTests.cs

示例10: StatsGetCollectionStatsAsyncTest

        public void StatsGetCollectionStatsAsyncTest()
        {
            Flickr f = TestData.GetAuthInstance();

            var collection = f.CollectionsGetTree().First();

            DateTime d = DateTime.Today.AddDays(-7);

            var w = new AsyncSubject<FlickrResult<Stats>>();
            f.StatsGetCollectionStatsAsync(d, collection.CollectionId, r => { w.OnNext(r); w.OnCompleted(); });

            var result = w.Next().First();
            Assert.IsFalse(result.HasError);
        }
開發者ID:h4ck3rm1k3,項目名稱:FlickrNet,代碼行數:14,代碼來源:StatsAsyncTests.cs

示例11: AuthGetFrobAsyncTest

        public void AuthGetFrobAsyncTest()
        {
            var w = new AsyncSubject<FlickrResult<string>>();

            TestData.GetOldSignedInstance().AuthGetFrobAsync(r => { w.OnNext(r); w.OnCompleted(); });

            var frobResult = w.Next().First();

            Assert.IsFalse(frobResult.HasError);

            string frob = frobResult.Result;

            Assert.IsNotNull(frob, "frob should not be null.");
            Assert.AreNotEqual("", frob, "Frob should not be zero length string.");
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:15,代碼來源:AuthTests.cs

示例12: PhotosAddTagTest

        public void PhotosAddTagTest()
        {
            Flickr f = TestData.GetAuthInstance();
            string photoId = "4499284951";
            string tag = "testx";

            var w = new AsyncSubject<FlickrResult<NoResponse>>();

            f.PhotosAddTagsAsync(photoId, tag, r => { w.OnNext(r); w.OnCompleted(); });

            //var result = w.Next().First();

            w.Next().First();

            //Assert.IsFalse(result.HasError);
        }
開發者ID:simm0n,項目名稱:Synchronizr,代碼行數:16,代碼來源:PhotosSearchAsyncTests.cs

示例13: PhotosSearchAsyncShowerTest

        public void PhotosSearchAsyncShowerTest()
        {
            var o = new PhotoSearchOptions();
            o.UserId = "[email protected]";
            o.Tags = "shower";
            o.SortOrder = PhotoSearchSortOrder.DatePostedDescending;
            o.PerPage = 1000;
            o.TagMode = TagMode.AllTags;
            o.Extras = PhotoSearchExtras.All;

            var w = new AsyncSubject<FlickrResult<PhotoCollection>>();

            AuthInstance.PhotosSearchAsync(o, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsTrue(result.Result.Total > 0);
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:17,代碼來源:PhotosSearchAsyncTests.cs

示例14: TestPhotoNotFoundAsync

        public void TestPhotoNotFoundAsync()
        {
            var w = new AsyncSubject<FlickrResult<PhotoInfo>>();

            Instance.PhotosGetInfoAsync("abcd", r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsTrue(result.HasError);
            throw result.Error;
        }
開發者ID:MichaelAzar,項目名稱:flickr-net,代碼行數:10,代碼來源:PhotosGetInfoTests.cs

示例15: PhotosetsGetPhotosAsyncTest

        public void PhotosetsGetPhotosAsyncTest()
        {
            Flickr f = TestData.GetInstance();

            var photoset = f.PhotosetsGetList(TestData.TestUserId).First();

            var w = new AsyncSubject<FlickrResult<PhotosetPhotoCollection>>();

            f.PhotosetsGetPhotosAsync(photoset.PhotosetId, PhotoSearchExtras.All, PrivacyFilter.PublicPhotos, 1, 50, MediaType.All, r => { w.OnNext(r); w.OnCompleted(); });
            var result = w.Next().First();

            Assert.IsFalse(result.HasError);
        }
開發者ID:ericleigh007,項目名稱:flickr-net,代碼行數:13,代碼來源:PhotosetsAsyncTests.cs


注:本文中的AsyncSubject.Next方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。