Ejemplo n.º 1
0
        public void MustNotFailIfActionsAreNull()
        {
            var sut = new DelegateOperation(null, null, null);

            var perform = sut.Perform();
            var repeat  = sut.Repeat();
            var revert  = sut.Revert();

            Assert.AreEqual(OperationResult.Success, perform);
            Assert.AreEqual(OperationResult.Success, repeat);
            Assert.AreEqual(OperationResult.Success, revert);
        }
Ejemplo n.º 2
0
        public void MustExecutePerformAction()
        {
            var performed = false;

            void perform() => performed = true;

            var sut = new DelegateOperation(perform);

            sut.Perform();

            Assert.IsTrue(performed);
        }