public void ShouldLaunchAndPopulateAbieEditorFormForParticularAbie() { ICctsRepository cctsRepository = CctsRepositoryFactory.CreateCctsRepository(new EARepositoryAbieEditor()); IAbie abieToBeUpdated = cctsRepository.GetAbieByPath(EARepositoryAbieEditor.PathToBIEPerson()); //IAbie abieToBeUpdated = cctsRepository.GetAbieByPath(EARepositoryAbieEditor.PathToBIEAddress()); var t = new Thread(() => new Application().Run(new AbieEditor(cctsRepository, abieToBeUpdated.Id))); t.SetApartmentState(ApartmentState.STA); t.Start(); t.Join(); }
public void ShouldCreateAbieInRepository() { target.SetSelectedCandidateCcLibrary("cclib1"); target.SetSelectedCandidateAcc("Person"); target.SetSelectedAndCheckedCandidateBcc("FirstName", true); target.SetSelectedAndCheckedPotentialBbie("FirstName", true); target.SetSelectedAndCheckedPotentialBdt("Text", true); target.AbiePrefix = "MyPrefix"; target.AbieName = "MyAbie"; target.SetSelectedCandidateBdtLibrary("bdtlib1"); target.SetSelectedCandidateBieLibrary("bielib1"); target.SetSelectedAndCheckedPotentialAsbie("homeAddress", true); target.SetSelectedAndCheckedPotentialAsbie("workAddress", true); target.CreateAbie(); IAbie testAbie = cctsRepository.GetAbieByPath((Path)"test model" / "blib1" / "bielib1" / "MyPrefixMyAbie"); Assert.IsNotNull(testAbie); Assert.That(testAbie.BasedOn.Name, Is.EqualTo("Person")); foreach (IBbie bbie in testAbie.Bbies) { Assert.That(bbie.Name, Is.EqualTo("FirstName")); Assert.That(bbie.Bdt.Name, Is.EqualTo("Text")); } Assert.That(testAbie.BieLibrary.Name, Is.EqualTo("bielib1")); Assert.That(testAbie.BasedOn.CcLibrary.Name, Is.EqualTo("cclib1")); Assert.That(testAbie.Asbies.Count(), Is.EqualTo(2)); int i = 0; foreach (IAsbie asbie in testAbie.Asbies) { Console.WriteLine(asbie.Name); if (i == 0) { Assert.That(asbie.Name, Is.EqualTo("homeAddress")); } else { Assert.That(asbie.Name, Is.EqualTo("workAddress")); } i++; } }