public void ObjectDataSource_ViewState () { ObjectDataSourcePoker ods = new ObjectDataSourcePoker (); //InitObjectDataSource (ods,""); ods.CacheDuration = 1; ods.CacheExpirationPolicy = DataSourceCacheExpiry.Sliding; ods.CacheKeyDependency = "key"; ods.ConflictDetection = ConflictOptions.CompareAllValues; ods.ConvertNullToDBNull = true; ods.DataObjectTypeName = "DataObjectType"; ods.DeleteMethod = "deleteMethod"; ods.EnableCaching = true; ods.EnablePaging = true; ods.FilterExpression = "filter expression"; ods.InsertMethod = "insertMethod"; ods.MaximumRowsParameterName = "maxRows"; ods.OldValuesParameterFormatString = "old_{0}"; ods.SelectCountMethod = "selectCountMethod"; ods.SelectMethod = "selectMethod"; ods.SortParameterName = "sortParamName"; ods.SqlCacheDependency = "cacheDependency"; ods.StartRowIndexParameterName = "startRow"; ods.TypeName = "TypeName"; ods.UpdateMethod = "updateMethod"; object state = ods.SaveState (); Assert.IsNull (state, "ViewState is null"); ObjectDataSourcePoker copy = new ObjectDataSourcePoker (); copy.LoadState (state); }