public void BindingPasses() { { var viewObj = new EmptyViewObject() { UseModel = new Model(), UseBindInfo = new ModelViewBinder.BindInfo(typeof(EmptyViewObject)), }; Assert.IsTrue(viewObj.DoBinding()); Debug.Log($"Success to DoBinding()"); int counter = 0; viewObj.OnUnbinded.Add(_v => counter++); viewObj.Unbind(); Assert.IsNull(viewObj.UseModel); Assert.IsNull(viewObj.UseBindInfo); Assert.IsFalse(viewObj.DoBinding()); Assert.AreEqual(1, counter); Debug.Log($"Success to Unbind()"); counter = 0; viewObj.Unbind(); // <- when DoBinding() == false Assert.AreEqual(0, counter); Debug.Log($"Success to not Call OnUnbind() when Bind Nothing!"); } { var viewObj = new EmptyViewObject() { UseModel = null, UseBindInfo = new ModelViewBinder.BindInfo(typeof(EmptyViewObject)), }; Assert.IsFalse(viewObj.DoBinding()); } { var viewObj = new EmptyViewObject() { UseModel = new Model(), UseBindInfo = null, }; Assert.IsFalse(viewObj.DoBinding()); } { var viewObj = new EmptyViewObject() { UseModel = null, UseBindInfo = null, }; Assert.IsFalse(viewObj.DoBinding()); } Debug.Log($"Success all Case (DoBinding() == false)!"); }