BlueCollar.Examples.CreateFileJob.Execute C# (CSharp) Method

Execute() public method

Executes the job.
public Execute ( ) : void
return void
        public override void Execute()
        {
            if (!File.Exists(this.Path))
            {
                File.AppendAllText(this.Path, "Hello, world!", Encoding.UTF8);
            }
        }

Usage Example

 public void ExamplesCreateFileJob()
 {
     CreateFileJob job = new CreateFileJob();
     Assert.IsFalse(File.Exists(job.Path));
     job.Execute();
     Assert.IsTrue(File.Exists(job.Path));
 }
CreateFileJob