Exemplo n.º 1
0
        public void CreateAndDeleteFile(IFileInfoWrap fi)
        {
            IFileStreamWrap fs = fi.Create();

            fs.Close();
            fi.Delete();
        }
Exemplo n.º 2
0
        public void Check_that_FileInfo_methods_Create_and_Delete_are_called()
        {
            // Add mock repository.
            IFileInfoWrap   fileInfoRepository   = MockRepository.GenerateMock <IFileInfoWrap>();
            IFileStreamWrap fileStreamRepository = MockRepository.GenerateMock <IFileStreamWrap>();

            // Create expectations
            fileInfoRepository.Expect(x => x.Create()).Return(fileStreamRepository);
            fileStreamRepository.Expect(x => x.Close());
            fileInfoRepository.Expect(x => x.Delete());

            // Test
            new FileInfoSample().CreateAndDeleteFile(fileInfoRepository);

            // Verify expectations.
            fileInfoRepository.VerifyAllExpectations();
            fileStreamRepository.VerifyAllExpectations();
        }
Exemplo n.º 3
0
 public NativeFileEntry(IFileInfoWrap fileInfo)
 {
     this.FileInfo = fileInfo;
 }
Exemplo n.º 4
0
 public void CreateAndDeleteFile(IFileInfoWrap fi)
 {
     IFileStreamWrap fs = fi.Create();
     fs.Close();
     fi.Delete();
 }
Exemplo n.º 5
0
 public FileProcessHandler(IFileWrap file, IPathWrap path, IFileInfoWrap fileInfo)
 {
     _file     = file;
     _fileInfo = fileInfo;
     _path     = path;
 }