public void CloneBBList() { UnitTestContext context = GetContext(); ListContainerList list = new ListContainerList(); ListContainerList clone = list.Clone(); context.Assert.AreEqual(list.Count, clone.Count, "Failed to clone"); context.Assert.Success(); context.Complete(); }
public void ListOfLists() { bool rcc = false; bool ccc = false; bool cc = false; Csla.Core.ChildChangedEventArgs cca = null; var root = new ListContainerList(); var child = new ContainsList(true); root.Add(child); child.List.Add(new SingleRoot(true)); root.ChildChanged += (o, e) => { rcc = true; }; #if !SILVERLIGHT System.ComponentModel.PropertyDescriptor lcp = null; root.ListChanged += (o, e) => { Assert.Fail("root.ListChanged should not fire"); }; #else root.CollectionChanged += (o, e) => { Assert.IsTrue(false, "root.ListChanged should not fire"); }; #endif child.ChildChanged += (o, e) => { ccc = true; }; child.PropertyChanged += (o, e) => { Assert.IsTrue(false, "child.PropertyChanged should not fire"); }; #if !SILVERLIGHT bool lc = false; child.List.ListChanged += (o, e) => { lc = true; lcp = e.PropertyDescriptor; }; #endif child.List.ChildChanged += (o, e) => { cc = true; cca = e; }; child.List[0].Name = "abc"; #if !SILVERLIGHT Assert.IsTrue(lc, "ListChanged should have fired"); Assert.IsNotNull(lcp, "PropertyDescriptor should be provided"); Assert.AreEqual("Name", lcp.Name, "PropertyDescriptor.Name should be Name"); #endif Assert.IsTrue(rcc, "root.ChildChanged should have fired"); Assert.IsTrue(ccc, "child.ChildChanged should have fired"); Assert.IsTrue(cc, "list.ChildChanged should have fired"); Assert.IsTrue(ReferenceEquals(child.List[0], cca.ChildObject), "Ref should be equal"); }