public void OpenCustomerDetail() { using (CustomersList list = (CustomersList)ModulesManager.Current.OpenModuleObjectDetail(new CustomersListObject(Session), false)) { list.OpenDetail(Andrew.Oid, null); CustomerDetailView detailView = CustomerDetailView.LastCreatedView; Assert.IsNotNull(detailView); Assert.AreEqual(Andrew.Oid, detailView.Module.CustomerEdit.VRObjectEditObject.VideoRentObject.Oid); detailView.Module.Dispose(); } }
public void TryOpenCustomerDetailWithNullCurrentRecord() { using (CustomersList list = (CustomersList)ModulesManager.Current.OpenModuleObjectDetail(new CustomersListObject(Session), false)) { CustomerDetailView.LastCreatedView = null; list.CustomersEdit.CurrentRecord = null; list.CommandEdit(null); CustomerDetailView detailView = CustomerDetailView.LastCreatedView; Assert.IsNull(detailView); } }
public void OpenCustomerDetail_SetCurrentCustomer() { using (CustomersList list = (CustomersList)ModulesManager.Current.OpenModuleObjectDetail(new CustomersListObject(Session), false)) { list.OpenDetail(Andrew.Oid, null); CustomerDetailView detailView = CustomerDetailView.LastCreatedView; Assert.IsNotNull(detailView); detailView.Module.SetAsCurrentCustomer(); detailView.Module.Dispose(); } LayoutManager.Current.Logout(); Assert.IsTrue(LayoutManager.Current.Login(ReferenceData.AdministratorString, string.Empty, Session)); Assert.AreEqual(Andrew.Oid, ViewModelLayoutData.GetLayoutData().CurrentCustomerOid); }
public CustomerDetailView(CustomerDetail customerDetail) : base(customerDetail) { LastCreatedView = this; }