예제 #1
0
        public void CopyToRetryRemoteTest()
        {
            FileRetryCommand cmd = new FileRetryCommand();
            ConfigData stationConfig = new ConfigData(configStream);
            cmd.Initialize(stationConfig);

            string newID = DateTime.Now.Ticks.ToString();

            string remoteTargetDir = @"\\test1.company.com\C$\Inspector\Test\Delay\Ready\";
            string remoteTargetPath = remoteTargetDir + newID + ".tif";

            // delete existing file
            // NOTE: This is commented out because it had problems getting error 1219 from the UNC connection
            // Workaround: new filename every time.
            //string possibleError;
            //bool useUNC;
            //UNCAccessWithCredentials unc =
            //    Util.ConnectUNC("administrator", "password", remoteTargetDir, out possibleError, out useUNC);
            //Assert.IsNull(possibleError, "Error trying to delete remote test file: " + possibleError);
            //if (File.Exists(remoteTargetPath))
            //{
            //    File.Delete(remoteTargetPath);
            //}
            //if (unc != null) unc.Dispose();

            FileFolderInstance instance = new FileFolderInstance();
            instance.ID = newID;
            instance.FileName = "DOC46711.tif";
            instance.Location = "FileFolderTest/Failed/" + instance.FileName;
            instance.Path = ConfigDataTest.TESTFILEDIR + instance.Location;

            cmd.CopyToRetry(instance);

            Assert.IsTrue(File.Exists(remoteTargetPath));
        }
예제 #2
0
 private FileRetryCommand CreateTestCommand()
 {
     ConfigData stationConfig = new ConfigData(configStream);
     FileRetryCommand target = new FileRetryCommand();
     target.Initialize(stationConfig);
     return target;
 }