public void serialize_whenPathNull()
        {
            var obj = new DirectoryCreateCommand();

            var navigator = obj.XmlSerialize().CreateNavigator();

            if (null == navigator.NameTable)
            {
                Assert.NotNull(navigator.NameTable);
            }
            else
            {
                Assert.True(navigator.Evaluate <bool>(@"1 = count(/directory.create[not(@path)])"));
            }
        }
        public void op_Revert_whenUnidirectional()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand(true)
                {
                    Path = temp.Info.ToDirectory("example").FullName,
                    Undo = true
                };

                Assert.True(obj.Act());
                Assert.True(obj.Revert());
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }
        public void op_Act_whenPathAlreadyExists()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand
                {
                    Path = temp.Info.FullName,
                    Undo = true
                };

                Assert.True(obj.Act());
                Assert.False(obj.Undo);
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }
        public void op_Act()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand
                {
                    Path = temp.Info.ToDirectory("example").FullName,
                    Undo = true
                };

                Assert.True(obj.Act());
                Assert.True(obj.Undo);
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }
        public void serialize()
        {
            var obj = new DirectoryCreateCommand
            {
                Path = @"C:\",
                Undo = true
            };

            var navigator = obj.XmlSerialize().CreateNavigator();

            if (null == navigator.NameTable)
            {
                Assert.NotNull(navigator.NameTable);
            }
            else
            {
                Assert.True(navigator.Evaluate <bool>(@"1 = count(/directory.create[@path='C:\'][@undo='true'][@unidirectional='false'])"));
            }
        }
        public void serialize_whenPathNull()
        {
            var obj = new DirectoryCreateCommand();

            var navigator = obj.XmlSerialize().CreateNavigator();

            if (null == navigator.NameTable)
            {
                Assert.NotNull(navigator.NameTable);
            }
            else
            {
                Assert.True(navigator.Evaluate<bool>(@"1 = count(/directory.create[not(@path)])"));
            }
        }
        public void serialize()
        {
            var obj = new DirectoryCreateCommand
                          {
                              Path = @"C:\",
                              Undo = true
                          };

            var navigator = obj.XmlSerialize().CreateNavigator();

            if (null == navigator.NameTable)
            {
                Assert.NotNull(navigator.NameTable);
            }
            else
            {
                Assert.True(navigator.Evaluate<bool>(@"1 = count(/directory.create[@path='C:\'][@undo='true'][@unidirectional='false'])"));
            }
        }
        public void op_Revert_whenUnidirectional()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand(true)
                              {
                                  Path = temp.Info.ToDirectory("example").FullName,
                                  Undo = true
                              };

                Assert.True(obj.Act());
                Assert.True(obj.Revert());
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }
        public void op_Act_whenPathAlreadyExists()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand
                              {
                                  Path = temp.Info.FullName,
                                  Undo = true
                              };

                Assert.True(obj.Act());
                Assert.False(obj.Undo);
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }
        public void op_Act()
        {
            using (var temp = new TempDirectory())
            {
                var obj = new DirectoryCreateCommand
                              {
                                  Path = temp.Info.ToDirectory("example").FullName,
                                  Undo = true
                              };

                Assert.True(obj.Act());
                Assert.True(obj.Undo);
                Assert.True(new DirectoryInfo(obj.Path).Exists);
            }
        }