public void PopulateRelationship(string entityLogicalName, Dictionary <string, HashSet <string> > inputEntityRelationships, ListViewItem listViewSelectedItem, ServiceParameters migratorParameters) { if (!workingstate) { lvRelationship.Items.Clear(); InitFilter(listViewSelectedItem); if (listViewSelectedItem != null) { using (var bwFill = new BackgroundWorker()) { bwFill.DoWork += (sender, e) => { var controller = new RelationshipController(); e.Result = controller.PopulateRelationshipAction(entityLogicalName, inputEntityRelationships, migratorParameters); }; bwFill.RunWorkerCompleted += (sender, e) => { var controller = new ListController(); controller.OnPopulateCompletedAction(e, NotificationService, this, lvRelationship); ManageWorkingState(false); }; bwFill.RunWorkerAsync(); } } } }
public void PopulateRelationshipActionNoManyToManyRelationships() { string entityLogicalName = "contact"; var entityMetadata = new EntityMetadata(); var migratorServiceParameters = GenerateMigratorParameters(); MetadataServiceMock.Setup(x => x.RetrieveEntities(It.IsAny <string>(), It.IsAny <IOrganizationService>(), It.IsAny <IExceptionService>())) .Returns(entityMetadata) .Verifiable(); var actual = systemUnderTest.PopulateRelationshipAction(entityLogicalName, inputEntityRelationships, migratorServiceParameters); actual.Count.Should().Be(0); ServiceMock.VerifyAll(); MetadataServiceMock.VerifyAll(); }