public CustomerFile AddFile(CustomerFile file)
 {
     return ExecuteFaultHandledOperation(() =>
     {
         ICustomerFileRepository customerFileRepository = _DataRepositoryFactory.GetDataRepository<ICustomerFileRepository>();
         CustomerFile addedFile = customerFileRepository.add(file);
         return addedFile;
     });
 }
        public void AddFile()
        {
            CustomerFile file = new CustomerFile() { AccountId = 1, FileName = "Test.txt",Type = FileType.LegalDoc,UploadDate = new DateTime(2015,10,18)};
            CustomerFile addedFile = new CustomerFile() { FileId = 1, AccountId = 1, FileName = "Test.txt", Type = FileType.LegalDoc, UploadDate = new DateTime(2015, 10, 18) };
            Mock<IDataRepositoryFactory> mockDataRepositoryFactory = new Mock<IDataRepositoryFactory>();
            mockDataRepositoryFactory.Setup(mock => mock.GetDataRepository<ICustomerFileRepository>().add(file)).Returns(addedFile);

            CustomerFileManager manager = new CustomerFileManager(mockDataRepositoryFactory.Object);
            CustomerFile addFileResults =  manager.AddFile(file);

            Assert.IsTrue(addedFile == addFileResults);
        }
 public void UpdateFile(CustomerFile file)
 {
     ExecuteFaultHandledOperation(() =>
     {
         ICustomerFileRepository customerFileRepository = _DataRepositoryFactory.GetDataRepository<ICustomerFileRepository>();
         CustomerFile updatedFile = customerFileRepository.Update(file);
     });
 }