Reset() public méthode

public Reset ( ) : void
Résultat void
Exemple #1
0
        public void ResetTest()
        {
            var apiStatus = new TwitterApiStatus();

            apiStatus.AccessLimit      = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.MediaUploadLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.AccessLevel      = TwitterApiAccessLevel.ReadWriteAndDirectMessage;

            apiStatus.Reset();

            Assert.That(apiStatus.AccessLimit, Is.Null);
            Assert.That(apiStatus.MediaUploadLimit, Is.Null);
            Assert.That(apiStatus.AccessLevel, Is.EqualTo(TwitterApiAccessLevel.Anonymous));
        }
        public void ResetTest()
        {
            var apiStatus = new TwitterApiStatus();

            apiStatus.AccessLimit["/statuses/home_timeline"] = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.MediaUploadLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.AccessLevel      = TwitterApiAccessLevel.ReadWriteAndDirectMessage;

            apiStatus.Reset();

            Assert.Null(apiStatus.AccessLimit["/statuses/home_timeline"]);
            Assert.Null(apiStatus.MediaUploadLimit);
            Assert.Equal(TwitterApiAccessLevel.Anonymous, apiStatus.AccessLevel);
        }
        public void ResetTest()
        {
            var apiStatus = new TwitterApiStatus();

            apiStatus.AccessLimit["/statuses/home_timeline"] = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.MediaUploadLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.AccessLevel = TwitterApiAccessLevel.ReadWriteAndDirectMessage;

            apiStatus.Reset();

            Assert.Null(apiStatus.AccessLimit["/statuses/home_timeline"]);
            Assert.Null(apiStatus.MediaUploadLimit);
            Assert.Equal(TwitterApiAccessLevel.Anonymous, apiStatus.AccessLevel);
        }
        public void AccessLimitUpdatedTest()
        {
            var apiStatus = new TwitterApiStatus();

            var eventCount = 0;

            apiStatus.AccessLimitUpdated += (s, e) => eventCount++;

            Assert.Equal(0, eventCount);

            apiStatus.AccessLimit["/statuses/home_timeline"] = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            Assert.Equal(1, eventCount);

            apiStatus.Reset();
            Assert.Equal(2, eventCount);
        }
Exemple #5
0
        public void AccessLimitUpdatedTest()
        {
            var apiStatus = new TwitterApiStatus();

            var eventCount = 0;

            apiStatus.AccessLimitUpdated += (s, e) => eventCount++;

            Assert.That(eventCount, Is.EqualTo(0));

            apiStatus.AccessLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            Assert.That(eventCount, Is.EqualTo(1));

            apiStatus.Reset();
            Assert.That(eventCount, Is.EqualTo(2));
        }
        public void AccessLimitUpdatedTest()
        {
            var apiStatus = new TwitterApiStatus();

            Assert.Raises <TwitterApiStatus.AccessLimitUpdatedEventArgs>(
                x => apiStatus.AccessLimitUpdated += x,
                x => apiStatus.AccessLimitUpdated -= x,
                () => apiStatus.AccessLimit["/statuses/home_timeline"] = new ApiLimit(150, 100, new DateTimeUtc(2013, 1, 1, 0, 0, 0))
                );

            Assert.Raises <TwitterApiStatus.AccessLimitUpdatedEventArgs>(
                x => apiStatus.AccessLimitUpdated += x,
                x => apiStatus.AccessLimitUpdated -= x,
                () => apiStatus.Reset()
                );
        }
        public void ResetTest()
        {
            var apiStatus = new TwitterApiStatus();

            apiStatus.AccessLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.MediaUploadLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            apiStatus.AccessLevel = TwitterApiAccessLevel.ReadWriteAndDirectMessage;

            apiStatus.Reset();

            Assert.That(apiStatus.AccessLimit, Is.Null);
            Assert.That(apiStatus.MediaUploadLimit, Is.Null);
            Assert.That(apiStatus.AccessLevel, Is.EqualTo(TwitterApiAccessLevel.Anonymous));
        }
        public void AccessLimitUpdatedTest()
        {
            var apiStatus = new TwitterApiStatus();

            var eventCount = 0;
            apiStatus.AccessLimitUpdated += (s, e) => eventCount++;

            Assert.That(eventCount, Is.EqualTo(0));

            apiStatus.AccessLimit = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            Assert.That(eventCount, Is.EqualTo(1));

            apiStatus.Reset();
            Assert.That(eventCount, Is.EqualTo(2));
        }
        public void AccessLimitUpdatedTest()
        {
            var apiStatus = new TwitterApiStatus();

            var eventCount = 0;
            apiStatus.AccessLimitUpdated += (s, e) => eventCount++;

            Assert.Equal(0, eventCount);

            apiStatus.AccessLimit["/statuses/home_timeline"] = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0));
            Assert.Equal(1, eventCount);

            apiStatus.Reset();
            Assert.Equal(2, eventCount);
        }