コード例 #1
0
 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));
 }
コード例 #2
0
        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"});
        }
コード例 #3
0
 public ConnectorViewModel(Connector connector)
     : base(connector)
 {
 }