Home | History | Annotate | Download | only in testapp
      1 /*
      2  * Copyright (C) 2015 The Android Open Source Project
      3  * Licensed under the Apache License, Version 2.0 (the "License");
      4  * you may not use this file except in compliance with the License.
      5  * You may obtain a copy of the License at
      6  *      http://www.apache.org/licenses/LICENSE-2.0
      7  * Unless required by applicable law or agreed to in writing, software
      8  * distributed under the License is distributed on an "AS IS" BASIS,
      9  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     10  * See the License for the specific language governing permissions and
     11  * limitations under the License.
     12  */
     13 
     14 package android.databinding.testapp;
     15 
     16 import android.databinding.testapp.BaseDataBinderTest;
     17 import android.databinding.testapp.R;
     18 import android.databinding.testapp.databinding.ObservableWithNotBindableFieldBinding;
     19 import android.databinding.testapp.vo.ObservableWithNotBindableFieldObject;
     20 
     21 import android.test.UiThreadTest;
     22 
     23 public class ObservableWithNotBindableFieldObjectTest extends BaseDataBinderTest<ObservableWithNotBindableFieldBinding> {
     24 
     25 
     26     public ObservableWithNotBindableFieldObjectTest() {
     27         super(ObservableWithNotBindableFieldBinding.class);
     28     }
     29 
     30     @UiThreadTest
     31     public void testSimple() {
     32         initBinder();
     33         ObservableWithNotBindableFieldObject obj = new ObservableWithNotBindableFieldObject();
     34         mBinder.setObj(obj);
     35         mBinder.executePendingBindings();
     36         assertEquals("", mBinder.textView.getText().toString());
     37         obj.update("100");
     38         mBinder.executePendingBindings();
     39         assertEquals("100", mBinder.textView.getText().toString());
     40     }
     41 }
     42