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); }
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); }
public static StateTransitionResult <SaleState, SaleEvent> Fire(Sale sale, SaleEvent saleEvent, ChangeTransaction change) { return(_saleStateManager.FireTrigger(sale, saleEvent, change)); }