public bool runTest()
{
Console.WriteLine(s_strTFPath + "\\" + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
String strLoc = "Loc_000oo";
String strValue = String.Empty;
int iCountErrors = 0;
int iCountTestcases = 0;
try
{
String filName = s_strTFAbbrev+"TestFile";
FileInfo fil2;
Stream stream;
if(File.Exists(filName))
File.Delete(filName);
strLoc = "Loc_r8r7j";
new FileStream(filName, FileMode.Create).Close();
fil2 = new FileInfo(filName);
stream = fil2.OpenWrite();
stream.Write(new Byte[]{10}, 0, 1);
stream.Close();
Thread.Sleep(4000);
fil2.Refresh();
iCountTestcases++;
try
{
DateTime d1 = DateTime.Now ;
DateTime d2 = fil2.LastAccessTime;
if(d1.Year != d2.Year || d1.Month != d2.Month || d1.Month != d2.Month)
{
iCountErrors++;
printerr( "Error_20hjx! Creation time cannot be correct");
}
}
catch (Exception exc)
{
iCountErrors++;
printerr( "Error_20fhd! Unexpected exceptiont thrown: "+exc.ToString());
printinfo( "");
}
strLoc = "Loc_20yxc";
stream = fil2.Open(FileMode.Open);
stream.Read(new Byte[1], 0, 1);
stream.Close();
fil2.Refresh();
Thread.Sleep(1000);
iCountTestcases++;
try
{
DateTime d1 = DateTime.Now ;
DateTime d2 = fil2.LastAccessTime;
if(d1.Year != d2.Year || d1.Month != d2.Month || d1.Month != d2.Month)
{
iCountErrors++;
Console.WriteLine((DateTime.Now-fil2.LastAccessTime).TotalMilliseconds);
printerr( "Eror_209x9! LastAccessTime is way off");
}
}
catch (Exception exc)
{
iCountErrors++;
printerr( "Error_209jx! Unexpected exception thrown: "+exc.ToString());
}
fil2.Delete();
if(File.Exists(filName))
File.Delete(filName);
}
catch (Exception exc_general )
{
++iCountErrors;
Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general=="+exc_general.ToString());
}
if ( iCountErrors == 0 )
{
Console.WriteLine( "paSs. "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
return true;
}
else
{
Console.WriteLine("FAiL! "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
return false;
}
}
public void printerr ( String err )