Exemplo n.º 1
0
        public void Should_be_able_to_try_remove_constraints()
        {
            var context = new ContextBag();

            var resultBeforeAdd = context.TryRemoveDeliveryConstraint(out DelayDeliveryWith _);

            context.AddDeliveryConstraint(new DelayDeliveryWith(TimeSpan.FromHours(1)));
            var resultAfterAdd = context.TryRemoveDeliveryConstraint(out DelayDeliveryWith _);

            Assert.IsFalse(resultBeforeAdd);
            Assert.IsTrue(resultAfterAdd);
        }
        public void Should_be_able_to_try_remove_constraints()
        {
            var context = new ContextBag();

            DelayDeliveryWith with;
            var resultBeforeAdd = context.TryRemoveDeliveryConstraint(out with);

            context.AddDeliveryConstraint(new DelayDeliveryWith(TimeSpan.FromHours(1)));
            var resultAfterAdd = context.TryRemoveDeliveryConstraint(out with);

            Assert.IsFalse(resultBeforeAdd);
            Assert.IsTrue(resultAfterAdd);
        }