Beispiel #1
0
 public InspectorViewModel()
 {
     noSelectedNode       = new EntityDummy();
     SetEntityNameOnEnter = new ActionCommand(SetEntityName, CanSetEntityName);
     AddEventToObject     = new ParamCommand(AddEvent, CanAddEvent);
     //Register message
     Messenger.Default.Register <SelectedItemChangeMessage>(this, ChangedSelectedProjectTreeItem);
 }
Beispiel #2
0
        public void Spec_IsSatisfiedByModel_False()
        {
            var model1 = new EntityDummy(34, "Maicon");
            var spec1  = new ModelStubSpecification();

            Assert.False(spec1.IsSatisfiedBy(model1));

            var model2 = new EntityDummy(35, "Maicon", false);
            var spec2  = Specification <EntityDummy> .Default.Not();

            Assert.False(spec2.IsSatisfiedBy(model2));
        }
Beispiel #3
0
        public void Spec_IsSatisfiedByModel_True()
        {
            var model1 = new EntityDummy(35, "Maicon", true);
            var spec1  = Specification <EntityDummy> .Default
                         .And(new ModelStubSpecification())
                         .And(new ModelStubSpecification2());

            Assert.True(spec1.IsSatisfiedBy(model1));

            var model2 = new EntityDummy(35, "Maicon", false);
            var spec2  = Specification <EntityDummy> .Default
                         .And(new ModelStubSpecification())
                         .Or(new ModelStubSpecification2());

            Assert.True(spec2.IsSatisfiedBy(model2));
        }