Ejemplo n.º 1
0
        public void op_Exclude_Operations_bool()
        {
            try
            {
                using (var temp = new TempDirectory())
                {
                    var resourceManager = Guid.NewGuid();
                    Recovery.MasterDirectory = temp.Info.ToDirectory("Recovery");
                    var operation1 = new Operation(resourceManager)
                    {
                        Info = Guid.NewGuid().ToString()
                    };

                    Recovery.Include(operation1);

                    var operation2 = new Operation(resourceManager)
                    {
                        Info = Guid.NewGuid().ToString()
                    };

                    Recovery.Include(operation2);
                    Recovery.Exclude(operation1, true);
                    var expected = Recovery.ItemFile(operation1, "Commit").FullName;
                    foreach (var actual in Recovery.MasterFile(operation1).Lines())
                    {
                        Assert.NotEqual(expected, actual);
                    }
                }
            }
            finally
            {
                Recovery.MasterDirectory = null;
            }
        }
Ejemplo n.º 2
0
        public void op_Exclude_Operation_bool()
        {
            try
            {
                using (var temp = new TempDirectory())
                {
                    Recovery.MasterDirectory = temp.Info.ToDirectory("Recovery");
                    var operation = new Operation(Guid.NewGuid())
                    {
                        Info = Guid.NewGuid().ToString()
                    };

                    Recovery.Include(operation);
                    Recovery.Exclude(operation, false);

                    var expected = Recovery.ItemFile(operation, "Rollback").FullName;
                    foreach (var actual in Recovery.MasterFile(operation).Lines())
                    {
                        Assert.NotEqual(expected, actual);
                    }
                }
            }
            finally
            {
                Recovery.MasterDirectory = null;
            }
        }
Ejemplo n.º 3
0
        public virtual void Done(bool success)
        {
            if (null != Info)
            {
                Trace.WriteIf(Tracing.Is.TraceVerbose, "Identity.ResourceManager={0}, Identity.Instance={1}".FormatWith(Identity.ResourceManager, Identity.Instance));
            }

            Recovery.Exclude(this, success);
        }
Ejemplo n.º 4
0
 public void op_Exclude_OperationNull_bool()
 {
     Assert.Throws <ArgumentNullException>(() => Recovery.Exclude(null, false));
 }