Beispiel #1
0
        public void WhenCreated_ThenEvaluationResultsAreEmpty()
        {
            var value   = new object();
            var binding = FixedBinding.Create(value);

            Assert.False(binding.EvaluationResults.Any());
        }
        public void WhenConstructed_ThenDoesNotAttachToSource()
        {
            var added   = false;
            var removed = false;

            var observable = new WeakObservableEvent <EventHandler, EventArgs>(
                handler => new EventHandler(handler.Invoke),
                handler => added   = true,
                handler => removed = true);

            Assert.False(added);
            Assert.False(removed);
        }
        public void WhenDeletingNonExistingProduct_ThenReturnsFalse()
        {
            var manager = Mocks.Of <IPatternManager>().First(x => x.Products == new IProduct[0] && x.IsOpen == true);

            var result = PatternManagerExtensions.Delete(manager, "foo");

            Assert.False(result);
        }
Beispiel #4
0
        public void WhenProductInstantiatedWhileSerializing_ThenDoesNotRaisePropertyChangeEvents()
        {
            var store = new DslTestStore <ProductStateStoreDomainModel>();

            store.Store.PropertyBag[ProductState.IsSerializingKey] = true;
            IProductState productState = null;

            store.TransactionManager.DoWithinTransaction(() =>
            {
                productState = store.ElementFactory.CreateElement <ProductState>();
            });

            bool     changed = false;
            IProduct product = null;

            productState.PropertyChanged += (sender, args) => changed = true;

            store.TransactionManager.DoWithinTransaction(() =>
            {
                product = productState.CreateProduct();
            });

            Assert.False(changed);
        }
        public void WhenDirectiveNameIsNotModelElement_ThenDirectiveIsNotSupported()
        {
            var processor = new ModelElementDirectiveProcessor();

            Assert.False(processor.IsDirectiveSupported("Foo"));
        }
Beispiel #6
0
 public void WhenChangedEventIsNull_ThenEvaluateFalse()
 {
     this.condition.PropertyName = "Foo";
     Assert.False(this.condition.Evaluate());
 }
Beispiel #7
0
 public void WhenTryingToConvertFromIn_ThenReturnsFalse()
 {
     Assert.False(this.converter.CanConvertFrom(typeof(int)));
 }