Esempio n. 1
0
        public void HandleSettingsResponse_Converts_Settings_To_Account()
        {
            var acctReqProc = new AccountRequestProcessor <Account>();

            Account acct = acctReqProc.HandleSettingsResponse(TestSettingsResponse);

            Assert.IsNotNull(acct);
            Assert.IsNotNull(acct.Settings);
            var settings = acct.Settings;

            Assert.IsNotNull(settings.TimeZone);
            var timeZone = settings.TimeZone;

            Assert.AreEqual("Mountain Time (US & Canada)", timeZone.Name);
            Assert.AreEqual(-21600, timeZone.UtcOffset);
            Assert.AreEqual("America/Denver", timeZone.TzInfoName);
            Assert.AreEqual("Mayoster", settings.ScreenName);
            Assert.AreEqual(true, settings.AlwaysUseHttps);
            Assert.AreEqual(true, settings.UseCookiePersonalization);
            Assert.IsNotNull(settings.SleepTime);
            var sleepTime = settings.SleepTime;

            Assert.AreEqual(true, sleepTime.Enabled);
            Assert.AreEqual(20, sleepTime.StartHour);
            Assert.AreEqual(0, sleepTime.EndHour);
            Assert.AreEqual(true, settings.GeoEnabled);
            Assert.AreEqual("en", settings.Language);
            Assert.AreEqual(true, settings.DiscoverableByEmail);
            Assert.AreEqual(true, settings.DiscoverableByMobilePhone);
            Assert.AreEqual(true, settings.DisplaySensitiveMedia);
            Assert.AreEqual("all", settings.AllowContributorRequest);
            Assert.AreEqual("following", settings.AllowDmsFrom);
            Assert.AreEqual("following", settings.AllowDmGroupsFrom);
            Assert.IsNotNull(settings.TrendLocation);
            var trendLocation = settings.TrendLocation;

            Assert.AreEqual("Las Vegas", trendLocation.Name);
            Assert.AreEqual("US", trendLocation.CountryCode);
            Assert.AreEqual("http://where.yahooapis.com/v1/place/2436704", trendLocation.Url);
            Assert.AreEqual(2436704, trendLocation.WoeID);
            Assert.AreEqual("Town", trendLocation.PlaceTypeName);
            Assert.AreEqual(7, trendLocation.PlaceTypeNameCode);
            Assert.AreEqual("23424977", trendLocation.ParentID);
            Assert.AreEqual("United States", trendLocation.Country);
        }
        public void HandleSettingsResponse_Converts_Settings_To_Account()
        {
            var acctReqProc = new AccountRequestProcessor <Account>();

            Account acct = acctReqProc.HandleSettingsResponse(TestSettingsResponse);

            Assert.NotNull(acct);
            Assert.Equal(23424977, acct.Settings.TrendLocation.WoeID);
            Assert.Equal("United States", acct.Settings.TrendLocation.Name);
            Assert.Equal(12, acct.Settings.TrendLocation.PlaceTypeNameCode);
            Assert.Equal("Country", acct.Settings.TrendLocation.PlaceTypeName);
            Assert.Equal("US", acct.Settings.TrendLocation.CountryCode);
            Assert.Equal("United States", acct.Settings.TrendLocation.Country);
            Assert.Equal("http://where.yahooapis.com/v1/place/23424977", acct.Settings.TrendLocation.Url);
            Assert.Equal(true, acct.Settings.GeoEnabled);
            Assert.Equal(false, acct.Settings.SleepTime.Enabled);
            Assert.Equal(0, acct.Settings.SleepTime.StartHour);
            Assert.Equal(0, acct.Settings.SleepTime.EndHour);
        }
        public void HandleSettingsResponse_Converts_Settings_To_Account()
        {
            var acctReqProc = new AccountRequestProcessor<Account>();

            Account acct = acctReqProc.HandleSettingsResponse(TestSettingsResponse);

            Assert.NotNull(acct);
            Assert.Equal(23424977, acct.Settings.TrendLocation.WoeID);
            Assert.Equal("United States", acct.Settings.TrendLocation.Name);
            Assert.Equal(12, acct.Settings.TrendLocation.PlaceTypeNameCode);
            Assert.Equal("Country", acct.Settings.TrendLocation.PlaceTypeName);
            Assert.Equal("US", acct.Settings.TrendLocation.CountryCode);
            Assert.Equal("United States", acct.Settings.TrendLocation.Country);
            Assert.Equal("http://where.yahooapis.com/v1/place/23424977", acct.Settings.TrendLocation.Url);
            Assert.Equal(true, acct.Settings.GeoEnabled);
            Assert.Equal(false, acct.Settings.SleepTime.Enabled);
            Assert.Equal(0, acct.Settings.SleepTime.StartHour);
            Assert.Equal(0, acct.Settings.SleepTime.EndHour);
        }
        public void HandleSettingsResponse_Converts_Settings_To_Account()
        {
            var acctReqProc = new AccountRequestProcessor<Account>();

            Account acct = acctReqProc.HandleSettingsResponse(TestSettingsResponse);

            Assert.IsNotNull(acct);
            Assert.IsNotNull(acct.Settings);
            var settings = acct.Settings;
            Assert.IsNotNull(settings.TimeZone);
            var timeZone = settings.TimeZone;
            Assert.AreEqual("Mountain Time (US & Canada)", timeZone.Name);
            Assert.AreEqual(-21600, timeZone.UtcOffset);
            Assert.AreEqual("America/Denver", timeZone.TzInfoName);
            Assert.AreEqual("Mayoster", settings.ScreenName);
            Assert.AreEqual(true, settings.AlwaysUseHttps);
            Assert.AreEqual(true, settings.UseCookiePersonalization);
            Assert.IsNotNull(settings.SleepTime);
            var sleepTime = settings.SleepTime;
            Assert.AreEqual(true, sleepTime.Enabled);
            Assert.AreEqual(20, sleepTime.StartHour);
            Assert.AreEqual(0, sleepTime.EndHour);
            Assert.AreEqual(true, settings.GeoEnabled);
            Assert.AreEqual("en", settings.Language);
            Assert.AreEqual(true, settings.DiscoverableByEmail);
            Assert.AreEqual(true, settings.DiscoverableByMobilePhone);
            Assert.AreEqual(true, settings.DisplaySensitiveMedia);
            Assert.AreEqual("all", settings.AllowContributorRequest);
            Assert.AreEqual("following", settings.AllowDmsFrom);
            Assert.AreEqual("following", settings.AllowDmGroupsFrom);
            Assert.IsNotNull(settings.TrendLocation);
            var trendLocation = settings.TrendLocation;
            Assert.AreEqual("Las Vegas", trendLocation.Name);
            Assert.AreEqual("US", trendLocation.CountryCode);
            Assert.AreEqual("http://where.yahooapis.com/v1/place/2436704", trendLocation.Url);
            Assert.AreEqual(2436704, trendLocation.WoeID);
            Assert.AreEqual("Town", trendLocation.PlaceTypeName);
            Assert.AreEqual(7, trendLocation.PlaceTypeNameCode);
            Assert.AreEqual("23424977", trendLocation.ParentID);
            Assert.AreEqual("United States", trendLocation.Country);
        }