当前位置: 首页>>代码示例>>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;未经允许,请勿转载。