Exemple #1
0
        public void RecordListInsertionComposition()
        {
            var semaphore = new Semaphore {
                Signal = Signal.STOP
            };
            var rec = new ModelChangeRecorder();

            rec.Start(railway);

            railway.Semaphores.Insert(0, semaphore);

            var expected = new ChangeTransaction()
            {
                SourceChange = new ListInsertionComposition <ISemaphore>(railway.AbsoluteUri, "Semaphores", 0, new List <ISemaphore>()
                {
                    semaphore
                }),
                NestedChanges = new List <IModelChange>()
                {
                    new ElementCreation(semaphore)
                }
            };
            var actual = rec.GetModelChanges().Changes[0];

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void SerializeChangeTransaction()
        {
            var sourceChange  = new ElementDeletion(uri);
            var nestedChanges = new[] { new ListDeletion(uri, property, 0, 1) };
            var change        = new ChangeTransaction(sourceChange, nestedChanges);

            SerializeAndAssert(change);
        }
Exemple #3
0
 public static StateTransitionResult <SaleState, SaleEvent> Fire(Sale sale, SaleEvent saleEvent, ChangeTransaction change)
 {
     return(_saleStateManager.FireTrigger(sale, saleEvent, change));
 }