public void One_Way_Binding_Should_Use_Converter_If_Specified() { Student student = new Student(); int intValue = 0; LambdaBinding.BindOneWay(() => student.Name, () => intValue, name => int.Parse(name)); student.Name = "451"; Assert.AreEqual(451, intValue); }
public void BaseCleanup() { Student = null; ResetDependency(); CleanUp(); //force garbage collection GC.Collect(); GC.WaitForPendingFinalizers(); }
public void BaseInit() { LastEventArgs = null; ChangeEventCount = 0; Student = TestUtil.CreateTestStudent(); //include the address field rather than the property! CreateDependency(); Dependency.DependencyChanged += OnDependencyChanged; Init(); //reset finalization counters TestUtil.ResetFinalizationCounters(); }
public void Test() { //assign a student MyStudent = new Student { Name = "Lucy" }; //set a school without an address MyStudent.School = new School {SchoolName = "University"}; //assign an address MyStudent.School.Address = new Address {City = "Redmond"}; //assign another address instance MyStudent.School.Address = new Address {City = "New York"}; //change the City property of the address MyStudent.School.Address.City = "Washington"; //cut the graph by removing the school reference MyStudent.School = null; //clear the MyStudent property completely MyStudent = null; }
protected override void Init() { FirstStudent = TestUtil.CreateTestStudent(); SecondStudent = TestUtil.CreateTestStudent(); base.Init(); }