public void GetNavigationalProperty() { var c = new Connector(); var nr = new NodeRelationship(); c.InvolvedRelationship = nr; var vm = IoCService.Instance.Resolve<ConnectorViewModel>(c); Assert.That(vm, Is.Not.Null); Assert.That(vm.Entity, Is.Not.Null); Assert.That(vm.Entity, Is.EqualTo(c)); Assert.That(vm.Entity.InvolvedRelationship, Is.EqualTo(nr)); Assert.That(vm.InvolvedRelationship, Is.Not.Null); Assert.That(vm.InvolvedRelationship.Entity, Is.EqualTo(nr)); }
public void SetNavigationalProperty_CheckFromModel() { var list = new List<string>(); var c = new Connector(); var nr = new NodeRelationship(); var vm = IoCService.Instance.Resolve<ConnectorViewModel>(c); vm.PropertyChanged += (sender, args) => { list.Add(args.PropertyName); }; c.InvolvedRelationship = nr; Assert.That(vm, Is.Not.Null); Assert.That(vm.Entity, Is.Not.Null); Assert.That(vm.Entity, Is.EqualTo(c)); Assert.That(vm.Entity.InvolvedRelationship, Is.EqualTo(nr)); Assert.That(vm.InvolvedRelationship, Is.Not.Null); Assert.That(vm.InvolvedRelationship.Entity, Is.EqualTo(nr)); CollectionAssert.AreEquivalent(list, new[] {"InvolvedRelationship"}); }
public ConnectorViewModel(Connector connector) : base(connector) { }