Ejemplo n.º 1
0
 public DoGetAction(IActivityIOPath path)
 {
     _logOnProvider   = new LogonProvider();
     _fileWrapper     = new FileWrapper();
     _path            = path;
     ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider);
 }
Ejemplo n.º 2
0
 public DoCreateDirectory(IActivityIOPath path, IDev2CRUDOperationTO args)
 {
     _logOnProvider   = new LogonProvider();
     _fileWrapper     = new FileWrapper();
     _dirWrapper      = new DirectoryWrapper();
     _path            = path;
     _crudArguments   = args;
     ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider);
     _handleOverwrite = RequiresOverwrite(_crudArguments, _path, _logOnProvider);
 }
 public DoGetFilesAsPerTypeOperation(IActivityIOPath path, ReadTypes type)
 {
     _logOnProvider   = new LogonProvider();
     _fileWrapper     = new FileWrapper();
     _dirWrapper      = new DirectoryWrapper();
     _path            = path;
     _type            = type;
     ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider);
     _newPath         = AppendBackSlashes(_path, _fileWrapper, _dirWrapper);
 }
        public void ValidateAuthorization_RequiresAuth_safeToken_IsNull_ExpectTrue()
        {
            //--------------------------Arrange--------------------------
            var mockDev2LogonProvider = new Mock <IDev2LogonProvider>();
            var mockActivityIOPath    = new Mock <IActivityIOPath>();
            //--------------------------Act------------------------------
            var doLogOn = ValidateAuthorization.RequiresAuth(mockActivityIOPath.Object, mockDev2LogonProvider.Object);

            //--------------------------Assert---------------------------
            Assert.IsNull(doLogOn);
        }
        public void ValidateAuthorization_DoLogOn_IsNull_ExpectTrue()
        {
            //--------------------------Arrange--------------------------
            var mockValidateAuthorization = new Mock <IDev2LogonProvider>();
            var mockActivityIOPath        = new Mock <IActivityIOPath>();
            //--------------------------Act------------------------------
            var doLogOn = ValidateAuthorization.DoLogOn(mockValidateAuthorization.Object, mockActivityIOPath.Object);

            //--------------------------Assert---------------------------
            Assert.IsNull(doLogOn);
        }
Ejemplo n.º 6
0
 public DoPutAction(Stream currentStream, IActivityIOPath destination, IDev2CRUDOperationTO crudArgument, string whereToPut)
 {
     _logOnProvider   = new LogonProvider();
     _pathWrapper     = new FilePathWrapper();
     _fileWrapper     = new FileWrapper();
     _currentStream   = currentStream;
     Destination      = destination;
     _arguments       = crudArgument;
     ImpersonatedUser = ValidateAuthorization.RequiresAuth(Destination, _logOnProvider);
     _whereToPut      = whereToPut;
 }