Dev2.Tests.DeleteHelperTest.DeleteHelper_Delete_WhenPathContainsStar_ExpectTrue C# (CSharp) Method

DeleteHelper_Delete_WhenPathContainsStar_ExpectTrue() private method

        public void DeleteHelper_Delete_WhenPathContainsStar_ExpectTrue()
        {
            //------------Setup for test--------------------------
            var tmpPath = Path.GetTempPath() + Guid.NewGuid();
            Directory.CreateDirectory(tmpPath);
            File.Create(tmpPath + "\\a.txt").Close();
            Directory.CreateDirectory(tmpPath + "\\b");

            //------------Execute Test---------------------------
            var result = DeleteHelper.Delete(tmpPath + "\\*.*");

            var dirStillExit = Directory.Exists(tmpPath);
            var contents = Directory.GetFiles(tmpPath);

            Cleanup(tmpPath);

            //------------Assert Results-------------------------
            Assert.IsTrue(result);
            Assert.IsTrue(dirStillExit);
            Assert.AreEqual(0, contents.Length);
        }