public void OnInitialized(IContainerProvider containerProvider) { if (AccountVM.TestService()) { IRegionManager regionManager = containerProvider.Resolve <IRegionManager>(); // IRegion region = regionManager.Regions["WorkspaceRegion"]; // region.RemoveAll(); //We get from the container an instance of AccountGrid. AccountGrid view = containerProvider.Resolve <AccountGrid>(); //We get from the region manager our target region. IRegion region = regionManager.Regions["WorkspaceRegion"]; //We inject the view into the region. region.Add(view); // regionManager.RegisterViewWithRegion("WorkspaceRegion", typeof(AccountGrid)); } else { throw new ModularityException(); } }
public void TestDelete() { AccountVM.TestService(); AccountVM accountVM = new AccountVM(50, 0); accountVM.GetAccount(-500); accountVM.Delete(); Object res = accountVM.GetAccount(-500); Assert.IsNull(res); }
public void TestService() { bool res = AccountVM.TestService(); Assert.AreEqual(true, res); }